Part Number Hot Search : 
FM104 20M00 ACJ5212 D1825 FM104 30KPA54A PCA9531 SMBJ5258
Product Description
Full Text Search
 

To Download ST52T430K1T6 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  rev. 1.9 - may 2003 1/88 this is preliminary information on a new product foreseen to be developed. details are subject to change without notice. preliminary datasheet st52t430/e430 8-bit intelligent controller unit (icu) three timer/pwms, adc, sci ? memories ? up to 8 kbytes eprom/otp ? 256 bytes of ram ? readout protection core ? register file based architecture ? 55 instructions ? hardware multiplication and division ? decision processor for the implementation of fuzzy logic algorithms clock and power supply ? up to 20 mhz clock frequency. ? power saving features interrupts ? 6 interrupt vectors ? top level external interrupt (int) peripherals ? 3 programmable 8-bit timer/pwms with internal 16-bit prescaler featuring: C pwm output C input capture C output compare C pulse generator mode ? watchdog timer ? on-chip 8-bit sample and hold a/d converter with 8-channel analog multiplexer ? serial communication interface with asynchronous protocol (uart) i/o ports ? 23 i/o pins configurable in input and output mode ? high current sink/source in all pins. development tools ? high level software tools ? emulator ? low cost programmer ? gang programmer st52x430 devices summary device nvm ram timer pwm adc sci watchdog operating supply i/o package st52t430k1 2k otp 256 3x8-bit 8-ch yes yes 3.0-5.5 v 23 sdip32 sso34 tqfp32 st52t430k2 4k otp 256 3x8-bit 8-ch yes yes 3.0-5.5 v 23 sdip32 sso34 tqfp32 st52t430k3 8k otp 256 3x8-bit 8-ch yes yes 3.0-5.5 v 23 sdip32 sso34 tqfp32 st52e430k3 8k eprom 256 3x8-bit 8-ch yes yes 3.0-5.5 v 23 csdip32w st52t430/e430
st52t430/e430 2/88
3/88 table of contents st52t430/e430 1 general description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7 1.2 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7 1.2.1 memory programming mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.2.2 working mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.3 pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12 2 internal architecture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.1 st52x430 operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14 2.2 control unit and data processing unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14 2.2.1 program counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.2.2 flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.3 address spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16 2.3.1 ram and stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.3.2 input registers bench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 2.3.3 configuration registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 2.3.4 output registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.4 arithmetic logic unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 3 eprom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 3.1 eprom programming phase procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 3.1.1 eprom operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 3.1.2 eprom locking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 3.1.3 eprom writing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 3.1.4 eprom read/verify margin mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 3.1.5 stand by mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 3.1.6 id code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 3.2 eprom erasure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 4 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 4.1 interrupt operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 4.2 global interrupt request enabling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 4.3 interrupt sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 4.4 interrupt maskability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 4.5 interrupt priority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 4.6 interrupts and low power mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 4.7 interrupt reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 5 clock, reset & power saving mode. . . . . . . . . . . . . . . . . . . . . . . . . . 32 5.1 system clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32 5.2 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32 5.3 power saving mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32 5.3.1 wait mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 5.3.2 halt mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 table of con- tents
st52t430/e430 4/88 6 i/o ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 6.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 6.2 input mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 6.3 output mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 6.4 alternate functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 6.5 i/o port configuration registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 7 fuzzy computation (dp). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 7.1 fuzzy inference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41 7.2 fuzzyfication phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41 7.3 inference phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41 7.4 defuzzyfication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42 7.5 input membership function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42 7.6 output singleton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43 7.7 fuzzy rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43 8 a/d converter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 8.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45 8.2 operational description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45 8.2.1 operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 8.2.2 power down mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 8.3 a/d registers description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 9 watchdog timer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 9.1 operational description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48 9.2 register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49 10 pwm/timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 10.1 timer mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 10.2 pwm mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 10.3 timer interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 11 serial communication interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 11.1 sci receiver block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 11.2 sci transmitter block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66 11.3 baud rate generator block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 12 electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 12.1 parameter conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 12.1.1 minimum and maximum values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 12.1.2 typical values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 12.1.3 typical curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 12.1.4 loading capacitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 12.1.5 pin input voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 12.2 absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 12.3 recommended operating condition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 12.4 supply current characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71
st52t430/e430 5/88 12.5 clock and timing characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73 12.6 memory characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74 12.7 esd pin protection strategy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75 12.7.1 standard pin protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 12.7.2 multi-supply configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 12.8 port pin characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 12.8.1 general characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 12.9 control pin characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80 12.9.1 reset pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 12.9.2 vpp pin. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 12.10 8-bit a/d characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81 ordering information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
st52t430/e430 6/88
st52t430/e430 7/88 1 general description 1.1 introduction st52x430 is an 8-bit intelligent control units (icu) of the st five family, which can perform both boolean and fuzzy algorithms in an efficient manner, in order to reach the best performances that the two methodologies allow. st52x430 is produced by stmicroelectronics using the reliable high performance cmos process, including integrated-on-chip peripherals that allow maximization of system reliability, decreasing system costs and minimizing the number of external components. the flexible i/o configuration of st52x400/440 allows for an interface with a wide range of external devices, like d/a converters or power control devices. st52x430 pins are configurable, allowing the user to set the input or output signals on each single pin. a hardware multiplier (8 bit by 8 bit with 16 bit result) and a divider (16 bit over 8 bit with 8 bit result and 8 bit remainder) are available to implement complex functions by using a single instruction. the program memory utilization and computational speed is optimized. fuzzy logic dedicated structures in st52x430 icus can be exploited to model complex systems with high accuracy in a useful and easy way. fuzzy expert systems for overall system management and fuzzy real time controls can be designed to increase performances at highly competitive costs. the linguistic approach characterizing fuzzy logic is based on a set of if-then rules, which describe the control behavior, as well as on membership functions, which are associated to input and output variables. up to 334 membership functions, with triangular and trapezoidal shapes, or singleton values are available to describe fuzzy variables. the timer/pwm peripheral allows the management of power devices and timing signals, implementing different operating modes and high frequency pwm (pulse with modulation) controls. input capture and output compare functions are available on the timer. the programmable timer has a 16 bit internal prescaler and an 8 bit counter. it can use internal or external start/stop signals and clock. an internal programmable watchdog is available to avoid loop errors and to reset the icu. st52x430 includes an 8-bit analog to digital converter with an 8-analog channel multiplexer. single/multiple channels and single/sequence conversion modes are supported. a serial communication peripheral (sci), which uses the uart protocol allows data transfer from the st52x430 to other external devices. in order to optimize energy consumption, two different power saving modes are available: wait mode and halt mode. program memory (eprom/otp) addressing capability addresses up to 8 kbytes of memory locations to store both program instructions and permanent data. eprom can be locked by the user to prevent external undesired operations. operations may be performed on data stored in ram, allowing the direct combination of new input and feedback data. all bytes of ram are used like register file. otp (one time programmable) version devices are fully compatible with the eprom windowed version, which may be used for prototyping and pre-production phases of development. a powerful development environment consisting of a board and software tools allows an easy configuration and use of st52x430. the visual five tm software tool allows development of projects through a user-friendly graphical interface and optimization of generated code. 1.2 functional description st52x430 icu can work in two modes: n memory programming mode n working mode according to reset and vpp signals levels (see pins description). note: when reset=0 it is advisable not to use the sequence 101010 to port pa (7 : 2). 1.2.1 memory programming mode. the st52x430 memory is loaded in the memory programming phase. all fuzzy and standard instructions are written inside the memory. this phase starts by setting the control signals as illustrated below: when this phase starts, the st52x430 core is set to reset status; t hen 12v are applied to the vpp reset test v pp v ss v ss 12v/v dd
st52t430/e430 8/88 pin in order to start eprom programming. a signal applied to pb1 is used to increment the memory address; the data is supplied to port a (see eprom programming for further details). 1.2.2 working mode. below are the control signals of this mode: the processor starts the working phase following the instructions, which have been previously loaded in the memory. st52x430s internal structure includes a computational block, control unit (cu) / data processing unit (dpu), which allows processing of boolean functions and fuzzy algorithms. the cu/dpu can manage up to 334 different membership functions for the fuzzy rules antecedent part. the rule consequents are crisp values (real numbers). the maximum number of rules that can be defined is limited by the dimensions of the implemented standard algorithm. eprom is then shared between fuzzy and standard algorithms. the membership function data is stored inside the first 1024 memory locations. the fuzzy rules are parts of the program instructions. the control unit (cu) reads the information and the status deriving from the peripherals. arithmetic calculus can be performed on these values by using the internal cu and the 128/256 bytes of ram, which supports all computations. the peripheral input can be fuzzy and/or arithmetic output, or the values contained in data ram and eprom locations. figure 1.1 tqfp32 pin configuration reset test v pp v dd v ss v ss int / pc0 t0out / pc1 t1out / pc2 t2out / pc3 tx / pc4 rx / pc5 pc6 pc7 ain0 / pb0 ain1 / pb1 ain2 / pb2 ain3 / pb3 vdda gnda ain4 / pb4 ain5 / pb5 pb6 / ain6 pa7 / pb7 / ain7 pa6 pa5 / t0clk pa4 / strt pa3 / t2out pa2 / t1out pa1 / t0out pa0 / t0res vpp vss vdd reset oscout oscin test 1 2 3 4 5 6 7 8 24 23 22 21 20 19 18 17 9 10 11 12 13 14 15 16 32 31 30 29 28 27 26 25
st52t430/e430 9/88 figure 1.2 sso34 pin configuration figure 1.3 psdip32 pin configuration v dd vss v pp pa0/t0res pa1/t0out pa2/t1out pa3/t2out 34 33 31 30 29 28 27 26 25 24 23 22 21 20 19 18 1 2 3 7 4 5 6 8 9 10 11 12 13 14 15 16 17 32 pa4/t0strt pa5/t0clk pa6 pb7/pa7/ain7 nc pb6/ain6 pb5/ain5 pb4/ain4 pb2/ain2 pb3/ain3 gnda v dda pb1/ain1 pb0/ain0 nc pc6 rx/pc5 tx/pc4 t2out/pc3 t1out/pc2 t0out/pc1 int/pc0 test oscin oscout reset pc7 32 31 29 28 27 26 25 24 23 22 21 20 19 18 17 1 2 3 7 4 5 6 8 9 10 11 12 13 14 15 16 30 v dd vss v pp pa0/t0res pa1/t0out pa2/t1out pa3/t2out pa4/t0strt pa5/t0clk pa6 pb7/pa7/ain7 pb6/ain6 pb5/ain5 pb4/ain4 gnda v dda pb2/ain2 pb3/ain3 pb1/ain1 pb0/ain0 pc6 rx/pc5 tx/pc4 t2out/pc3 t1out/pc2 t0out/pc1 int/pc0 test oscin oscout reset pc7
st52t430/e430 10/88 table 1.1 st52x430 sso34 & psdip32 pin list sso34 pins sdip32 pins name programming phase working phase 1 1 reset general reset general reset 2 2 oscout oscillator output 3 3 oscin oscillator input 4 4 test must be tied to v ss must be tied to v ss 5 5 int/pc0 phase signal (phase) external interrupt, digital i/o 6 6 t0out/pc1 timer/pwm 0 output, digital i/o 7 7 t1out/pc2 timer/pwm 1 output, digital i/o 8 8 t2out/pc3 timer/pwm 2 output, digital i/o 9 9 tx/pc4 sci output, digital i/o 10 10 rx/pc5 sci input, digital i/o 11 11 pc6 digital i/o 12 12 pc7 digital i/o 13 nc 14 13 ain0/pb0 address reset (rst_add) analog input, digital i/o 15 14 ain1/pb1 address increment (inc_add) analog input, digital i/o 16 15 ain2/pb2 configuration reset (rst_conf) analog input, digital i/o 17 16 ain3/pb3 configuration increment (inc_conf) analog input, digital i/o 18 17 v dda analog power supply analog power supply 19 18 gnda analog ground analog ground 20 19 ain4/pb4 analog input, digital i/o 21 20 ain5/pb5 analog input, digital i/o 22 nc 23 21 ain6/pb6 analog input, digital i/o 24 22 ain7/pb7/pa7 i/o eprom data analog input, digital i/o 25 23 pa6 i/o eprom data digital i/o 26 24 t0clk/pa5 i/o eprom data timer/pwm 0 clock, digital i/o 27 25 t0strt/pa4 i/o eprom data timer/pwm 0 start/stop, digital i/o 28 26 t2out /pa3 i/o eprom data timer/pwm 2 compl. output, digital i/o 29 27 t1out /pa2 i/o eprom data timer/pwm 1 compl. output, digital i/o 30 28 t0out /pa1 i/o eprom data timer/pwm 0 compl. output, digital i/o 31 29 t0res/pa0 i/o eprom data timer/pwm 0 reset, digital i/o 32 30 v pp eprom programming power supply (12v 5%) eprom v dd or vss 33 31 v ss digital ground digital ground 34 32 v dd digital power supply digital power supply
st52t430/e430 11/88 table 1.2 st52x430 tqfp32 pin list tqfp32 pins name programming phase working phase 1 int/pc0 phase signal (phase) external interrupt, digital i/o 2 t0out/pc1 timer/pwm 0 output, digital i/o 3 t1out/pc2 timer/pwm 1 output, digital i/o 4 t2out/pc3 timer/pwm 2 output, digital i/o 5 tx/pc4 sci output, digital i/o 6 rx/pc5 sci input, digital i/o 7 pc6 digital i/o 8 pc7 digital i/o 9 ain0/pb0 address reset (rst_add) analog input, digital i/o 10 ain1/pb1 address increment (inc_add) analog input, digital i/o 11 ain2/pb2 configuration reset (rst_conf) analog input, digital i/o 12 ain3/pb3 configuration increment (inc_conf) analog input, digital i/o 13 v dda analog power supply analog power supply 14 gnda analog ground analog ground 15 ain4/pb4 analog input, digital i/o 16 ain5/pb5 analog input, digital i/o 21 ain6/pb6 analog input, digital i/o 22 ain7/pb7/pa7 i/o eprom data analog input, digital i/o 19 pa6 i/o eprom data digital i/o 20 t0clk/pa5 i/o eprom data timer/pwm 0 clock, digital i/o 21 t0strt/pa4 i/o eprom data timer/pwm 0 start/stop, digital i/o 22 t2out /pa3 i/o eprom data timer/pwm 2 compl. output, digital i/o 23 t1out /pa2 i/o eprom data timer/pwm 1 compl. output, digital i/o 24 t0out /pa1 i/o eprom data timer/pwm 0 compl. output, digital i/o 25 t0res/pa0 i/o eprom data timer/pwm 0 reset, digital i/o 26 v pp eprom programming power supply (12v 5%) eprom v dd or vss 27 v ss digital ground digital ground 28 v dd digital power supply digital power supply 29 reset general reset general reset 30 oscout oscillator output 31 oscin oscillator input 32 test must be tied to v ss must be tied to v ss
st52t430/e430 12/88 1.3 pin description v dd , v ss , v dda , gnda, v pp . in order to avoid noise disturbances, the power supply of the digital part is kept separate from the power supply of the analog part. v dd. main power supply voltage (5v 10%). v ss . digital circuit ground. v dda . analog v dd of the analog to digital converter. gnda . analog v ss of the analog to digital converter. must be tied to v ss . v pp . main power supply for internal eprom (12.5v 5%, in programming phase) and mode selector. during the programming phase (programming), v pp must be set at 12v. in the working phase v pp must be equal to v ss . oscin and oscout. these pins are internally connected with the on-chip oscillator circuit. a quartz crystal or a ceramic resonator can be connected between these two pins in order to allow the correct operations of st52x430 with various stability/cost trade-off. an external clock signal can be applied to oscin, in this case oscout must be floating. reset . this signal is used to restart st52x430 at the beginning of its program. it also allows one to select the program mode for eprom. ain0-ain8. these 8 lines are connected to the input of the analog multiplexer. they allow the acquisition of 8 analog input. during the programming phase, ain0, ain1, ain2 and ain3 are used to manage eprom operation. pa0-pa7, pb0-pb7, pc0-pc7 . these lines are organized as i/o port. each pin can be configured as input or output. pa7/pb7 are tied to the same output. during programming phase pa port is used for eprom read/write data. t0res , t0clk , t0strt . these pins are related with the internal programmable timer/pwm 0. this timer can be reset externally by using t0res. in working mode, t0res resets the address counter of the timer. t0res is active at low level. the timer 0 clock can be the internal clock or can be supplied externally by using pin t0clk. an external start/stop signal can be used to control the timer through t0strt pin. t0out, t1out, t2out. the timer/pwm outputs are available on these pins. t0out , t1out , t2out . the timer/pwm complementary outputs are available on these pins. tx. serial data output of sci transmitter block rx . serial data input of the sci receiver block. test . during the programming and working phase it must be set to vss .
st52t430/e430 13/88 figure 1.4 st52x430 block diagram port a timer/pwm 0 port c timer/pwm 1 timer/pwm 2 pa7:0 sci pc7:0 port b pb7:0 adc watchdog program memory eprom core alu & dpu decision processor register file 256 bytes input registers pc flags power supply oscillator vdd vpp vss oscin oscout reset control unit interrupts controller reset circuit vdda gnda
st52t430/e430 14/88 2 internal architecture st52x430 is made up of the following blocks and peripherals: n control unit (cu) and data processing unit (dpu) n alu / fuzzy core n eprom n 256 byte ram n clock oscillator n analog multiplexer and a/d converter n 3 pwm / timers n sci n digital i/o port 2.1 st52x430 operating modes st52x430 works in two modes, programming and working modes, depending on the control signals level reset, test and v pp the operating modes are selected by setting the control signal level as specified in the control signals setting table. 2.2 control unit and data processing unit the control unit (cu) formally includes five main blocks. each block decodes a set of instructions, generating the appropriate control signals. the main parts of the cu are illustrated in figure 2.1. the five different parts of the cu manage loading, logic/arithmetic, jump, control and the fuzzy instruction set. the block called collector manages the signals deriving from the different parts of the cu, defining the signals for the data processing unit (dpu) and the different peripherals of the microcontroller. the block called arbiter manages the different- parts of the cu so that only one part of the system is activated during working mode. the cu structure is very flexible. it was designed with the purpose of easily adapting the core of the microcontroller to market needs. new instruction sets or new peripherals can be easily included without changing the structure of the microcontroller, maintaining code compatibility. the cu reads the instructions stored on eprom (fetch) and decodes them. according to the instruction types, the arbiter activates one of the main blocks of the cu. afterwards, all the control signals for the dpu are generated. a set of 46 different arithmetic, fuzzy and logic instructions is available. each instruction requires 6 (fuzzy instructions) to 26 (division) clock pulses to be performed. the dpu receives, stores and sends instructions deriving from eprom, ram or peripherals in order to execute them. 2.2.1 program counter. the program counter (pc) is a 13-bit register that contains the address of the next memory location to be processed by the core. this memory location may be an opcode, operand, or an address of an operand. the 13-bit length allows direct addressing of a maximum of 8,192 bytes in the program space. after having read the current instruction address, the pc value is incremented. the result of this operation is shifted back into the pc. the pc can be changed in the following ways: n jp (jump)pc = jump address n interruptpc = interrupt vector n retipc = pop (stack) n retpc = pop (stack) n callpc = subroutines address n resetpc = reset vector n normal instructionpc = pc + 1 2.2.2 flags. the st52x430 core includes a different set of flags that correspond to 2 different modes: normal mode and interrupt mode. each set of flags con- sists of a carry flag (c), zero flag (z) and sign flag (s). one set (cn, zn, sn) is used during normal operation and one is used during interrupt mode (ci, zi, si). formally, the user has to manage only one set of flags: c, z and s . table 2.1 control signals setting control signal pro- gramming reset working reset v ss v ss v dd test v ss v ss v ss v pp 12 v v ss v ss
st52t430/e430 15/88 figure 2.1 data processing unit (dpu) figure 2.2 cu/dpu block diagram m u x program counter ram 256 bytes address ram stack point multiplexer accumulator fuzzy registers alu flags reg. add_epr peripherals cu eprom inputs peripherals e p r o m c u d p u ram to peripherals from p eripherals epro m address m icrocode ram addr. ram data 8 bit ram d a ta o u t 8 bit control signals 8 bit
st52t430/e430 16/88 the st52x430 core uses flags that correspond to the actual mode. as soon as an interrupt is generated the st52x430 core uses the interrupt flags instead of the normal flags. each interrupt level has its own set of flags, which is saved in the stack together with the program counter. these flags are restored from the stack automatically when a reti instruction is executed. if the mcu was in normal mode before an interrupt, the normal flags are restored when the reti instruction is executed. note: a call subroutine is a normal mode execution. for this reason, a ret instruction, consequent to a call instruction does not affect the normal mode set of flags. flags are not cleared during context switching and remain in the state they were at the end of the last interrupt routine switching. the carry flag is set when an overflow occurs during arithmetic operations, otherwise it is cleared. the sign flag is set when an underflow occurs during arithmetic operations, otherwise it is cleared. 2.3 address spaces st52x430 has four separate address spaces: n ram: 256 bytes figure 2.3 address spaces description n input registers: 20 8-bit registers n output registers 10 8-bit registers n configuration registers: 21 8-bit registers n program memory up to 8k bytes program memory will be described in further details in the memory section 2.3.1 ram and stack. ram memory consists of 256 general purpose 8- bit ram registers. all the registers in ram can be specified by using a decimal address. for example, 0 identifies the first register of ram. to read or write ram registers load instructions must be used. see table 2.5 each interrupt level has its own set of flags, which is saved in the stack together with the program counter. these flags are restored from the stack automatically when a reti instruction is executed. when the instructions like interrupt request or call are executed, a stack level is used to push the pc. the stack is located in ram. for each level of stack, 2 bytes of ram are used. the values of this stack are stored from the last ram register (address 255). the maximum level of stack must be less than 128 . st52x430 core program memory ram control unit dpu alu on chip peripherals peripheral registers configuration registers input registers ldri ldcr ldpr ldrc ldce peripheral block
st52t430/e430 17/88 the stack pointer indicates the first level available to store data. when a subroutine call or interrupt request occurs, the content of the pc and the current set of flags are stored into the level located by the stack pointer. when a interrupt return occurs (reti instruction), the data stored in the highest stack level is restored back into the pc and current flags. instead, when a subroutine return occurs (ret instruction) the data stored in the highest stack level are restored in the pc not affecting the flags. these operating modes are illustrated in figure 2.4. note: the user must pay close attention to avoid overwriting ram locations where the stack could be stored . 2.3.2 input registers bench. the input registers (ir) bench consists of 20 8-bit registers containing data or the status of the peripherals. all the registers can be specified by using a decimal address (for example, 0 identifies the first register of the ir). the assembler instruction: ldri ram_reg. ir_i loads the value of the i-th ir in the ram location identified by the ram_reg address. the first input register is dedicated to store the value of the stack pointer. the next 8 registers (adc_out_0:7) of the ir are dedicated to the 8 converted values deriving from the adc. the last 9 input registers contain data from the i/o ports and pwm/timers. the following table summarizes the ir address and the relative peripherals. in order to simplify the concept, a mnemonic name is assigned to the registers. the same name is used in visualstudio ? development tools figure 2.4 stack operation program counter ram reg 0 reg 1 reg 2 reg 3 reg 4 reg 5 reg 255 reg 254 reg 253 reg 252 stack level 1 stack level 2 .......................... stack level n when call or i nterrupt req. when reti or ret occurs occurs stack poi nter
st52t430/e430 18/88 2.3.3 configuration registers. the st52x430 configuration registers allow the configuration of all the blocks of the fuzzy microcontroller. table 2.3 describes the functions and the related peripherals of each of the configuration registers. by using the load instructions, the configuration registers can be set by using values stored in the program memory (eprom) or in ram. use and meaning of each register will be described in further details in the corresponding section. table 2.2 input registers ir mnemonic name peripheral register address stack_pointer stack pointer 0 chan 0 a/d channel 0 1 chan 1 a/d channel 1 2 chan 2 a/d channel 2 3 chan 3 a/d channel 3 4 chan 4 a/d channel 4 5 chan 5 a/d channel 5 6 chan 6 a/d channel 6 7 chan 7 a/d channel 7 8 port_a port a input register 9 port_b port b input register 10 port_c port c input register 11 pwm_ 0_count pwm/timer 0 counter 12 pwm_ 0_ status pwm/timer 0 status register 13 pwm_ 1_ count pwm/timer 1 counter 14 pwm_ 1_ status pwm/timer 1 status register 15 pwm_ 2_ count pwm/timer 2 counter 16 pwm_ 2_ status pwm/timer 2 status register 17 sci_rx sci data register 18 sci_status sci status register 19 table 2.3 configuration registers configuration register peripheral description reg_conf 0 interrupt mask interrupts mask setting reg_conf 1 n.u. n.u. reg_conf 2 watchdog timer watchdog timer configuration reg_conf 3 a/d converter a/d configuration
st52t430/e430 19/88 2.3.4 output registers. the output registers (or) consist of 10 registers containing data for the microcontroller peripherals including the i/o ports. all registers can be specified by using a decimal address (for example, 1 identifies the second or). by using load instructions the output registers (or) may be set by using values stored in the program memory (ldpe) or in ram (ldpr) the assembler instruction: ldpr or_i ram_reg. loads the value of the ram location identified by the address ram_reg in the or i-th table 2.4 describes or. in order to simplify the concept, a mnemonic name is assigned to or. the same names are used in fuzzystudio tm 4.0 development tools. use and meaning of each register will be described in further details in the corresponding section. reg_conf 4 port a set the relative bit like digital input or digital output reg_conf 5 pwm/timer 0 pwm/timer 0 working mode configuration reg_conf 6 pwm/timer 0 pwm/timer 0 prescaler configuration and output waveform selection. reg_conf 7 pwm/timer 0 pwm/timer 0 working mode configuration reg_conf 8 pwm/timer 1 pwm/timer 1 working mode configuration reg_conf 9 pwm/timer 1 pwm/timer 1 prescaler configuration and output waveform selection. reg_conf 10 pwm/timer 2 pwm/timer 2 working mode configuration reg_conf 11 pwm/timer 2 pwm/timer 2 prescaler configuration and output waveform selection. reg_conf 12 port a set the bit 0,1 and 2 like digital i/o or complementary timers output. reg_conf 13 port b set the relative bit like digital input or digital output. reg_conf 14 port b set the relative i/o like digital or analog. reg_conf 15 port c set the relative i/o like digital input or digital output reg_conf 16 port c set the relative i/o like digital i/o or timers output reg_conf 17 interrupt priority set the interrupts priority reg_conf 18 interrupt priority set the interrupts priority reg_conf 19 sci set the sci working mode reg_conf 20 sci set the sci working mode table 2.3 configuration registers (continued) configuration register peripheral description
st52t430/e430 20/88 2.4 arithmetic logic unit the 8-bit arithmetic logic unit (alu) allows the performance of arithmetic calculations and logic instructions, which can be divided into 5 groups: load, arithmetic, jump, interrupts and program control instructions (refer to the st52x430 assembler set for further details). the computational time required for each instruction consists of one clock pulse for each cycle plus 3 clock pulses for the decoding phase. the alu of the st52x430 can perform multiplication (mult) and division (div). multiplication is performed by using 8 bit operands storing the result in 2 registers (16 bit values), see figure 2.5 and figure 2.6. warning: if the lsb of the multiplication result is 0, the zero flag is set although the result is not 0. table 2.4 output registers or mnemonic name peripheral register address port_ a port a or 0 port_ b port b or 1 port_c port c or 2 pwm_0_count timer/pwm 0 counter 3 pwm_0_reload timer/pwm 0 reload register 4 pwm_1_count timer/pwm 1 counter 5 pwm_1_reload timer/pwm 1 reload register 6 pwm_ 2_ count timer/pwm 2 counter 7 pwm_2_reload timer/pwm 2 reload register 8 sci_tx_data sci data register 9 table 2.5 load instructions load instructions mnemonic instruction bytes cycles z s c ldce ldce conf, eprom 3 17 - - - ldcr ldcr conf, ram 3 14 - - - ldfr ldfr fuzzy_i_ram ram 3 14 - - - ldpe ldpe per, eprom 3 17 - - - ldpe ldpe per, (ram) 3 17 - - - ldpr ldpr reg, ram 3 14 - - - ldrc ldrc ram, const 3 14 - - - ldre ldre rami, epromi 3 16 - - - ldre ldre (rami), (ramj) 3 18 - - - ldri ldri ram, inp_reg 3 15 - - - ldrr ldrr rami, ramj 3 16 - - -
st52t430/e430 21/88 pgset pgset const 2 9 - - - table 2.6 arithmetic & logic instructions set arithmetic instructions mnemonic instruction bytes cycles z s c add add regi, regj 3 17 i - i addo addo regi, regj 3 20 i i i and and regi, regj 3 17 i - - asl asl regi 2 15 i - i asr asr regi 2 15 i i - dec dec regi 2 15 i i - div div regi, regj 3 26 i i i inc inc regi 2 15 i - i mult mult regi, regj 3 19 i - - not not regi 2 15 i - - or or regi, regj 3 17 i - - sub sub regi, regj 3 17 i i - subo subo regi, regj 3 20 i i i mirror mirror regi 2 15 i - - table 2.7 jump instruction set jump instructions mnemonic instruction bytes cycles z s c call call addr 3 18 - - - jp jp addr 3 12 - - - jpc jpc addr 3 10/12 - - - jpnc jpnc addr 3 10/12 - - - jpns jpns addr 3 10/12 - - - jpnz jpnz addr 3 10/12 - - - jps jps addr 3 10/12 - - - jpz jpz addr 3 10/12 - - - ret ret 1 13 - - - table 2.8 interrupt instructions set interrupt instructions mnemonic instruction bytes cycles z s c halt halt 1 7/15 - - - megi megi 1 7/15 - - - table 2.5 load instructions
st52t430/e430 22/88 notes: i affected - not affected figure 2.5 multiplication figure 2.6 division mdgi mdgi 1 6 - - - reti reti 1 12 - - - rint rint int 2 8 - - - udgi udgi 1 6 - - - uegi uegi 1 7/15 - - - waiti waiti 1 7/14 - - - table 2.9 control instructions set control instructions mnemonic instruction bytes cycles z s c fuzzy fuzzy 1 5 - - - nop nop 1 6 - - - wdtrfr wdtrfr 1 7 - - - wdtslp wdtslp 1 6 - - - table 2.8 interrupt instructions set (continued) ram 0 1 2 i j+1 j-1 j 255 253 254 reg. j reg. j+1 remainder quotient reg. i : i-1 i+1 ram 0 1 2 i j+1 j-1 j 255 253 254 reg. j reg. i lsb msb x 16 bit
st52t430/e430 23/88 3 eprom eprom memory provides an on-chip user- programmable non-volatile memory, which allows fast and reliable storage of user data. eprom memory can be locked by the user. in fact, a memory location called lock cell is devoted to lock eprom and avoid external operations. a software identification code, called id code, distinguishes which software version is stored in the memory. 64 kbits of memory space with an 8-bit internal parallelism (up to 8 kbytes) addressed by an 13-bit bus are available. the data bus is 8 bits. memory has a double supply: v pp is equal to 12v 5% in programming phase or to v ss during working phase. v dd is equal to 5v 10%. st52x430 eprom memory is divided into three main blocks (see figure ): n interrupt vectors memory block (3 through 20) contains the addresses for the interrupt routines. each address is composed of three bytes. n mbfs setting memory block (21 through memadd ) contains the coordinates of the vertexes of every mbf defined in the program. figure 3.1 program memory organization n the maximum value of memadd is 1023. this area is dynamically assigned according to the size of the fuzzy routines. the unused memory area, if any, is assigned to the program instruction set memory block. n the program instructions set memory block (memadd through memaddx) contains the instruction set of the user program. the following table summarizes the values of mem addx for the different devices table 3.1 mem addx locations 0, 1 and 2 contain the address of the first microcode instruction.the operations that can be performed on eprom during the programming phase are: stand by, memory writing, reading and verify/margin mode, memory lock, idcode writing and verify. st52t430k1 st52t430 st52t430 me m 2047 4095 8191 0 2 3 20 program instruction first address int_ext int_sci int_timer/pwm2 int_timer/pwm1 int_timer/pwm0 int_adc 8191 memadd mbfs parameters fuzzy and boolean algorithms program instruction set mbfs setting and program instruction set interrupt vectors 21 2047 4095 st52430k2 st52430k1 st52430k3 memadd+1
st52t430/e430 24/88 figure 3.2 eprom programming timing the operations above are managed by using the internal 4-bit eprom control register. the reading phase is executed with v pp = 5v 5%, while the verify/margin mode phase needs v pp = 12v 5%. the blank check must be a reading operation with v pp = 5v 5%. table 3.2 illustrates eprom control register codes used to identify the operation running. 3.1 eprom programming phase procedure the programming mode is selected by applying 12v 5% voltage or 5v 5% voltage to the v pp pin and setting the control signal as following: reset =vss test =vss if the v pp voltage is 5v 5% only reading may be performed. rst_add, inc_add, rst_conf, inc_conf and phase are the control signals used during the programming mode. phase, rst_conf and rst_add signals are active on level, the others are active on rising edge. table 3.2 eprom control register operation register value stand by 0 memory reading/verify 1 memory unlock and lock status reading 2 memory writing 3 memory lock 4 id code writing 5 memory lock status reading/verify 9 id code reading/ verify 10 memory unlock memory writing location address =1 data in m e m o r y v e r ify m a r g i n m o d e d ata o ut v alid d ata v a l i d d a t a valid data d a t a o u t data out 100ns 10 m s pa(0:7) rst_add rst_conf inc_add inc_conf phase
st52t430/e430 25/88 phase and rst_add signals are active low, rst_conf signal is active high. port a is used for the memory data i/o. (see table 3.2 for pin reference on the different packages) . memory may be locked by means of the memory lock status, which is a flag used to enable eprom operations. if memory lock status is 1 all eprom operations are enabled, otherwise the user may only read (and verify) the otp code and the memory lock status. only if eprom is not locked by means of lock cell (see eprom locking may eprom operations be enabled by changing the memory lock status from 0 to 1. rst_add signal resets the memory address register and the memory lock status. when the rst_add becomes high, the memory must be unlocked in order to read or write. inc_add signal increments the memory address. rst_conf signal resets the eprom control register. when rst_conf is high, the data i/ o port a is in output, otherwise it is always in input. inc_conf signal increments the eprom control register value. phase si gnal validates the operation selected by means of the eprom control register value. 3.1.1 eprom operation. in order to execute an eprom operation (see table 3.2), the corresponding identification value must be loaded in the eprom control register. the signal timing is the following: rst_add= high and phase= high, rst_conf changes from low to high level, to reset the eprom control register, and inc_conf signal generates a number of positive pulses equal to the value to be loaded. after this sequence, a negative pulse of the phase signal will validate the operation selected. the minimum phase si gnal pulse width must be 10 m s for eprom writing operation and 100 ns for the others. when rst_conf is high, data i/o port a is enabled in output and the reading/verifying operation results are available. after a writing operation, when rst_conf is high, port a is in output without valid data. 3.1.2 eprom locking. the memory lock operation, which is identified with the number 4 in the eprom control register, writes 0" in the memory lock cell. at the beginning of an external operation, when the rst_add signal changes from low level to high level, the memory lock status is 0", therefore it must be unlocked before proceeding. in order to unlock the memory lock status the operation, which is identified by the number 2 in the eprom control register must be executed (see figure 3.2). memory lock status can be changed only if memory lock cell is 1". after a memory lock operation external operations cannot be executed except to read (or verify) the otp code and the memory lock status. 3.1.3 eprom writing. when the memory is blank, all bits are at logic level 1". data is introduced by programming only the zeros in the desired memory location. however, all input data must contain both 1" and 0". the only way to change 0" into 1" is to erase the entire memory (by exposure to ultra violet light) and reprogram it. the memory is in writing mode when the eprom control register value is 3. the v pp voltage must be 12v 5%, with stable data on the data bus pa(0:7). the timing signals are the following (see figure ): 1) rst_add and rst_conf change from low to high level, 2) two pulses on inc_conf signal load the memory unlock operation code, 3) a negative pulse (100 ns) on the phase signal validates the memory unlock operation, 4) a negative pulse on rst_conf signal resets the eprom control register, 5) three positive pulses on inc_conf load the memory writing operation code, 6) a train of positive pulses on inc_add signal increments the memory location address up to the requested value (generally this is a sequential operation and only one pulse is used), 7) a negative pulse (10 m s) on the phase signal validates the memory writing operation.
st52t430/e430 26/88 3.1.4 eprom read/verify margin mode. the read phase is executed with v pp = 5v 5%, instead of the verify phase that needs v pp = 12v 5%. the memory verify operation is available in order to verify the accuracy of the data written. a memory verify margin mode operation can be executed immediately after writing each byte, in this case (see figure ): 1) a positive pulse on rst_conf signal resets the eprom control register, if it wasnt already reset; 2) one positive pulse on inc_conf loads the memory read/verify operation code; 3) a negative pulse (100 ns) on the phase signal validates the memory reading / verify operation; 4) a negative pulse on rst_conf signal puts in the pa(0:7) port the value stored in the actual memory address and resets the eprom control register; if an error occurred writing, the user has to repeat eprom writing. 3.1.5 stand by mode. eprom has a standby mode, which reduces the active current from 10ma (programming mode) to less than 100 m a. memory is placed in standby mode by setting the phase signal at a high level or when the eprom control register value is 0 and the phase signal is low. 3.1.6 id code. a software identification code, called id code may be written in order to distinguish which software version is stored in the memory. 64 bytes are dedicated to store this code by using the address values from 0 to 63. the id code may be read or verified even if the memory lock status is 0". the timing signals are the same as that of a normal operation. 3.2 eprom erasure the transparent window available in the csdip32w package, allows the memory contents to be erased by exposure to uv light. erasure begins when the device is exposed to light with a wavelength shorter than 4000?. sunlight, as well as some types of artificial light, includes wavelengths in the 3000-4000? range which, on prolonged exposure can cause erasure of memory contents. therefore, it is recommended that eprom devices be fitted with an opaque label over the window area in order to prevent unintentional erasure. the erasure procedure recommended for eprom devices consists of exposure to short wave uv light having a wavelength of 2537?. the minimum integrated dose recommended (intensity x expo- sure time) for complete erasure is 15wsec/cm 2. this is equivalent to an erasure time of 15-20 minutes using a uv source having an intensity of 12mw/cm 2 at a distance of 25mm (1 inch) from the device window.
st52t430/e430 27/88 4 interrupts the control unit (cu) responds to peripheral events and external events via its interrupt channels. when such an events occur, if the related interrupt is not masked and according to a priority order, the current program execution can be suspended to allow the cu to execute a specific response routine. each interrupt is associated with an interrupt vector that contains the memory address of the related interrupt service routine. each vector is located in the program space (eprom memory) at a fixed address (see interrupt vectors table 4.2). 4.1 interrupt operation if there are pending interrupts at the end of an arithmetic or logic instruction, the one with the highest priority is passed. passing an interrupt means storing the arithmetic flags and the current pc in the stack and executing the associated interrupt routine, whose address is located in three bytes of the eprom memory location between address 3 and 20. the interrupt routine is performed as a normal code, checking if a higher priority interrupt has to be passed at the end of each instruction. an interrupt request with the higher priority stops the lower priority interrupt. the program counter and the arithmetic flags are stored in the stack. with the reti (return from interrupt) instruction the arithmetic flags and program counter (pc) are restored from the top of the stack. this stack was already described in section ram and stack. an interrupt request cannot stop processing of the fuzzy rule, but this is passed only after the end of a fuzzy rule or at the end of a logic, or arithmetic instruction. note: a fuzzy routine can only be interrupted in the main program. an interrupt request cannot stop a fuzzy function that is running inside another interrupt routine. in order to use a fuzzy function inside an interrupt routine, the user must include the fuzzy function between an udgi (mdgi) instruction and an uegi (megi) instruction (see the following paragraphs), so that the interrupt request may be disabled during the execution of the fuzzy function. 4.2 global interrupt request enabling when an interrupt occurs, it generates a global interrupt pending (gip), that can be masked by software. after a gip a global interrupt request (gir) will be generated and interrupt service figure 4.1 interrupt flow figure 4.2 interrupt vectors mapping figure 4.3 global interrupt request generation normal program flow interrupt servi ce routi ne reti instruction i nterrupt int_adc int_timer/pwm2 int_sci 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 interrupt vectors int_ext 18 19 20 int_timer/pwm1 int_timer/pwm0 global interrupt pending user global interrupt mask macro global global interrupt request
st52t430/e430 28/88 routine associated to the interrupt with higher priority will start. in order to avoid possible conflicts between interrupt masking set in the main program, or inside high level language compiler macros, the gip is hung up through the user global interrupt mask or the macro global interrupt mask (see figure 4.2). uegi/udgi instruction switches on/off the user global interrupt mask, enabling/disabling the gir for the main program. megi/mdgi instructions switch the macro global interrupt mask on/off, in order to ensure that the macro will not be broken. 4.3 interrupt sources st52x430 manages interrupt signals generated by the internal peripherals (pwm/timers, uart and analog to digital converter) or coming from the int/pc0 pin. the external interrupt can be programmed to be active on the rising or falling edge of int/pc0 signal by setting the pextint bit of the configuration register to 0. warning: changing the interrupt priority an interrupt request is generated. each peripheral can be programmed in order to generate the associated interrupt; further details are described in the related chapter. 4.4 interrupt maskability the interrupts can be masked by configuring the reg_conf 0 by means of ldcr, or ldce, instruction. the interrupt is enabled when the bit associated to the mask interrupt is 1". viceversa, when the bit is 0", the interrupt is masked and is kept pendent. for example: ldrc 10,6 //load the constant 6 in the ram register 10 ldcr 0, 10 // set the conf_reg 0 with the value stored in the ram register 10 the result is conf_reg0 =00000110 enabling the interrupts deriving from the adc (int_adc) and from the pwm/timer 0 (int_pwm/timer0). reset configuration 000000 table 4.1 configuration register 0 description bit name value description 0mske 0 external interrupt masked 1 external interrupt not masked 1 mskad 0 a/d converter interrupt masked 1 a/d converter interrupt not masked 2 msktm0 0 pwm/timer 0interrupt masked 1 pwm/timer 0 interrupt not masked 3 msktm1 0 pwm/timer 1 interrupt masked 1 pwm/timer 1 interrupt not masked 4 msktm2 0 pwm/timer 2 interrupt masked 1 pwm/timer 2 interrupt not masked 5msci 0 sci interrupt masked 1 sci interrupt not masked 6 pextint 0 external interrupt polarity active on rising 1 external interrupt polarity active on falling 7 not used
st52t430/e430 29/88 figure 4.4 interrupt configuration register 0 table 4.2 interrupts description name description priority peripheral code maskable eprom locations int_adc adc int programmable 000 yes 3-5 int_pwm/ timer0 pwm/timer 0 int programmable 001 yes 6-8 int_pwm/ timer1 pwm/timer 1 int programmable 010 yes 9-11 int_pwm/ timer2 pwm/timer 2 int programmable 011 yes 12-14 int_sci sci int programmable 100 yes 15-17 int_ext external interrupt (int) ext highest - yes 18-20 d0 d1 d2 d3 d4 d5 d6 d7 mske: ext. int. not used pextint: ext. int. polariry msci: sci int. msktm0: timer0 int. mskad: a/d int. msktm1: timer1 int. msktm2: timer2 int. reg_conf0 interrupts mask
st52t430/e430 30/88 figure 4.5 interrupt configuration register 17 & 18 4.5 interrupt priority seven priority levels are available: level 6 has the lowest priority, level 0 has the highest priority. level 6 is associated to the main program, levels 5 to 1 are programmable by means of the priority registers called reg_conf17 and reg_conf18 (see figure 4.5 and table 4.3); whereas the higher level is related to the external interrupt (int_ext). pwm/timers, uart and adc are identified by a three-bit peripheral codes (see table 4.2); in order to set the i -th priority level the user must write the peripheral label i in the related int i priority level. i.e. ldrc 10, 193 //(load the value 193=11000001 in the ram register 10) ldrc 11, 168 //(load the value 168=10101000 in the ram register 11) ldcr 17, 10 // set the reg_conf17= 11000001 ldcr 18, 11 // set the reg_conf18= 10101000 the following priority levels are defined: n level 1: int_pwm/timer0 (pwm/timer 0 code: 001) n level 2: int_adc (adc code: 000) n level 3: int_pwm/timer2 (pwm/timer 2 code: 011) n level 4: int_uart (uart code: 100) n level 5: int_pwm/timer1 (pwm/timer 1 code: 010) table 4.3 conf. register 17 & 18 description bit name value level 0, 1,2 int1 periphera l code high 3, 4,5 int2 periphera l code medium-high 6,7,8 int3 periphera l code medium-low 9,10,11 int4 periphera l code low 12,13,1 4 int5 periphera l code very low d0 d1 d2 d3 d4 d5 d6 d7 int 1 not used int 2 reg_conf17 interrupts priority d8 d9 d10 d11 d12 d13 d14 d15 reg_conf18 int 3 int 5 int 4
st52t430/e430 31/88 figure 4.6 example of a sequence of interrupt requests remark: the interrupt priority must be set at the beginning of the main program, because at the reset reg_conf1=00000000, this condition could generate wrong operations. further, changing the priority levels must be avoided in interrupt service routines. when a source provides an interrupt request and the request processing is also enabled, the cu changes the normal sequential flow of a program by transferring program control to a selected service routine. when an interrupt occurs the cu executes a jump instruction to the address loaded in the related location of the interrupt vector. when the execution returns to the original program it immediately begins following the instruction that was interrupted. 4.6 interrupts and low power mode all interrupts allow the processor to leave the wait low power mode. only the external interrupt allows the processor to leave the halt low power mode. 4.7 interrupt reset an eventually pending interrupt can be reset with the instruction rint j , which resets the interrupt j -th where j identifies the peripherals as described in the following table (see table 4.4). the assembler instruction: rint 2 resets the pwm/timer 1 interrupt. note : the rint command must be preceded from a udgi (or mdgi) command and followed by a uegi (or megi) command . warning: if an interrupt is reset, with the rint instruction within its own interrupt routine, the priority level of the interrupt becomes the lowest and the routine can be immediately interrupted by a lower priority interrupt request. table 4.4 rint instruction code peripheral name value a/d converter 0 pwm/timer 0 1 pwm/timer 1 2 pwm/timer 2 3 sci 4 external interrupt 5 table 4.4 rint instruction code peripheral name value main program 5 4 3 2 1 0 int2 int0 int2 int1 int2 int3 int4 main program priority level int2 int0 int4 int1 int3 6
st52t430/e430 32/88 5 clock, reset & power saving mode 5.1 system clock the st52x430 clock generator module generates the internal clock for the internal control unit, alu and on-chip peripherals and it is designed to require a minimum number of external components. the st52x430 oscillator circuit generates an internal clock signal with the same period and phase as that of the oscin input pin. the maximum frequency allowed is 20 mhz . note: when the sci peripheral is used only a 5, 10, or 20 mhz system clock must be used. the system clock may be generated by using either a quartz crystal, ceramic resonator or an external clock. the different methods of the clock generator are illustrated in figure 5.1. when an external clock is used, it must be connected on the oscin pin, while oscout can be floating. the crystal oscillator start-up time is a function of many variables: crystal parameters (especially r s ), oscillator load capacitance (cl), ic parameters, environment temperature, supply voltage. figure 5.1 oscillator connections note: the crystal or ceramic leads and circuit connections must be as short as possible. typical values for cl1, cl2 are 10pf for a 20 mhz crystal. 5.2 reset there are two reset sources: - reset pin (external source.) - watchdog (internal source) when a reset event happens, the user program restarts from the beginning. the reset pin is an input. an internal reset does not affect this pin. a reset signal originated by external sources is recognized instantaneously. the reset pin may be used to ensure v dd has risen to a point where the mcu can operate correctly before the user program runs. in working mode reset must be set to 1 (see table 2.1). 5.3 power saving mode there are two power saving modes: wait and halt mode. these conditions may be entered using the wait or halt instructions. 5.3.1 wait mode wait mode places the mcu in low power consumption by stopping the cpu. all peripherals oscin oscout st52x430 oscin st52x430 oscout crystal clock external clock cl1 10pf cl2 10pf clock input
st52t430/e430 33/88 and the watchdog remain active. during wait mode, interrupts are enabled. the mcu will remain in wait mode until an interrupt or a reset occurs, whereupon the program counter jumps to the interrupt service routine or, if a reset occurs, at the beginning of the user program. remark: in wait mode the cpu clock does not stop. 5.3.2 halt mode halt mode is mcus lowest power consumption mode, which is entered by executing the halt instruction. the internal oscillator is turned off, causing all internal processing to stop, including the operations of the on-chip peripherals. figure 5.2 reset block diagram figure 5.3 simple reset circuit halt mode cannot be used when the watchdog is enabled. if the halt instruction is executed while the watchdog system is enabled, it will be skipped without modifying the normal cpu operations. the icu can exit halt mode after an external inter- rupt or reset. the oscillator is then turned on and stabilization time is provided before restarting cpu operations. stabilization time is 4096 cpu clock cycles after the interrupt and 1.000.000 after the reset. after the start up delay, the cpu restarts opera- tions by serving the external interrupt routine. reset makes the icu exit from halt mode and restart, after the delay, from the beginning of the user program after the delay. warning : if the external interrupt is disabled, the icu exits from the halt mode and jumps to the lower priority interrupt routine. figure 5.4 wait flow chart watchdog reset reset internal reset vcc 100 f 10k 2.2k 2.2k 1 f reset
st52t430/e430 34/88 halt instruction watchdog enabled halt instruction skipped yes no oscillator off peripherals clock off cpu clock off yes 4096 cpu clock cycles delay restart program servicing the external interrupt routine external interrupt no yes no external interrupt enabled restart program servicing the lower priority interrupt routine yes no reset reset cpu and restart user program oscillator on peripherals clock on cpu clock on 1000000 cpu clock cycles delay oscillator on peripherals clock on cpu clock on figure 5.5 halt flow chart
st52t430/e430 35/88 6 i/o ports 6.1 introduction st52x430 devices feature flexible individually programmable multi-functional input/output lines. refer to the following figure for specific pin allocations. 23 i/o lines, grouped in 3 different ports are available on the st52x430: port a = 7 or 8-bit ports (pa0 - pa7 pins) port b = 7 or 8-bit ports (pb0 - pb7 pins) port c = 8-bit port (pc0 - pc7 pins) pin 24 in the so34 or pin 22 in the pdip32 can be configured to belong to port a or to port b. these i/o lines can be programmed to provide digital input/output and analog input, or to connect input/output signals to the on-chip peripherals as alternate pin functions. input buffers are ttl compatible with schmitt trigger in port a and c while port b is cmos compatible without schmitt trigger. the output buffer can supply up to 8 ma. the port cannot be configured to be used contemporaneously as input and output. figure 6.1 ports a & c functional blocks each port is configured by using two configuration registers. the first is used to determine if a pin is an input or output, while the second defines the alternate functions. 6.2 input mode the input configuration is selected by setting the corresponding configuration register bit to 1 (reg_conf 4, 13 and 15) (see paragraph i/o port configuration registers). the ports are configured by using the configuration registers illustrated in the following table. . digital input data is automatically stored in the input registers, but it cannot be read directly. in order to read a single bit of the ir its value must be copied in a ram location. digital data is stored in a ram location by using the assembler instruction: ldri ram_reg input_i table 6.1 i/o port configuration registers. port a port b port c reg_conf 4 reg_conf 13 reg_conf 15 ttl port a pin or port c pin to input register and peripherals from peripheral from output register from configuration register from configuration register
st52t430/e430 36/88 figure 6.2 port b functional blocks 6.3 output mode the output configuration is selected by setting the corresponding configuration register bit to 0 (reg_conf 4, 13 and 15) (see paragraph i/o port configuration registers). digital data is transferred to the related i/o port by means of the output register via the assembler instructions ldpe or ldpr . 6.4 alternate functions several st52x430 pins are configurable to be used with different functions (see table 1.1). when an on-chip peripheral is configured to use a pin, the correct i/o mode of the related pin must be selected. for example: if pin 26 (pa5/t0clk in the so34) has to be used as an external pwm/timer0 clock, the reg_conf 4(5) bit must be set to 1. when the signal is an on-chip peripheral input the related i/o pin has to be configured in input mode. when a pin is used as an a/d converter input the related i/o pin is automatically set in tristate. the analog multiplexer (controlled by the a/d configuration register) switches the analog voltage present on the selected pin to the common analog rail, which is connected to the adc input. it is recommended that the voltage level not be changed or that any port pins not be loaded while conversion is running. furthermore, it is recommended that clocking pins not be located close to a selected analog pin. 6.5 i/o port configuration registers the i/o mode for each bit of the three ports is selected by using the configuration registers 4, table 6.2 input register and i/o ports port a port b port c ir 9 ir 10 ir 11 table 6.3 output register and i/o ports port a port b port c or 0 or 1 or 2 to a/d converter cmos port b pin from configuration register to input register from output registers from configuration register
st52t430/e430 37/88 13 and 15 (see table 6.1) the structure of these registers is illustrated in the following tables. each bit of the configuration registers determines the i/o mode of the related port pin. table 6.4 ports a reg_conf 4 bit name value description 0d0 0 set the pin pa0/t0res in output mode 1 set the pin pa0/t0res in input mode 1d1 0 set the pin pa1/t0out in output mode 1 set the pin pa1/t0out in input mode 2d2 0 set the pin pa2/t1out in output mode 1 set the pin pa2/t1out in input mode 3d3 0 set the pin pa3/t2out in output mode 1 set the pin pa3/t2out in input mode 4d4 0 set the pin pa4/t0strt in output mode 1 set the pin pa4/t0strt in input mode 5d5 0 set the pin pa5/t0clk in output mode 1 set the pin pa5/t0clk in input mode 6d6 0 set the pin pa6 in output mode 1 set the pin pa6 in input mode 7d7 0 set the pin pb7/pa7/ ain7 in output mode 1 set the pin pb7/pa7/ ain7 in input mode reset configuration 11111111 table 6.5 ports b reg_conf 13 bit name value description 0d0 0 set the pin pb0/ain0 in output mode 1 set the pin pb0/ain0 in input mode 1d1 0 set the pin pb1/ain1 in output mode 1 set the pin pb1/ain1 in input mode 2d2 0 set the pin pb2/ain2 in output mode 1 set the pin pb2/ain2 in input mode 3d3 0 set the pin pb3/ain3 in output mode 1 set the pin pb3/ain3 in input mode 4d4 0 set the pin pb4/ain4 in output mode 1 set the pin pb4/ain4 in input mode 5d5 0 set the pin pb5/ain5 in output mode 1 set the pin pb5/ain5 in input mode 6d6 0 set the pin pb6/ain6 in output mode 1 set the pin pb6/ain6 in input mode 7d7 0 set the pin pb7/pa7/ ain7 in output mode 1 set the pin pb7/pa7/ ain7 in input mode reset configuration 11111111
st52t430/e430 38/88 analog input option. the pb0-pb7 pins can be configured to be analog inputs according to the codes programmed in the configuration register reg_conf 14 (see table 6.7). these analog inputs are connected to the on-chip 8-bit analog to digital converter. table 6.6 port c reg_conf 15 bit name value description 0d0 0 set the pin int/pc0 in output mode 1 set the pin int/pc0 in input mode 1d1 0 set the pin t0out/ pc1 in output mode 1 set the pin t0out/ pc1 in input mode 2d2 0 set the pin t1out/ pc2 in output mode 1 set the pin t1out/ pc2 in input mode 3d3 0 set the pin t2out/ pc3 in output mode 1 set the pin t2out/ pc3 in input mode 4d4 0 set the pin tx/pc4 in output mode 1 set the pin tx/pc4 in input mode 5d5 0 set the pin rx/pc5 in output mode 1 set the pin rx/pc5 in input mode 6d6 0 set the pin pc6 in output mode 1 set the pin pc6 in input mode 7d7 0 set the pin pc7 in output mode 1 set the pin pc7 in input mode reset configuration 11111111 table 6.7 analog inputs (reg_conf 14) bit name value description 0d0 0 pin pb0/ain0 digital i/o 1 pin pb0/ain0 analog 1d1 0 pin pb1/ain1 digital i/o 1 pin pb1/ain1 analog 2d2 0 pin pb2/ain2 digital i/o 1 pin pb2/ain2 analog 3d3 0 pin pb3/ain3 digital i/o 1 pin pb3/ain3 analog 4d4 0 pin pb4/ain4 digital i/o 1 pin pb4/ain4 analog 5d5 0 pin pb5/ain5 digital i/o 1 pin pb5/ain5 analog 6d6 0 pin pb6/ain6 digital i/o 1 pin pb6/ain6 analog 7d7 0 pin pb7/ain7 digital i/o 1 pin pb7/ain7 analog reset configuration 11111111
st52t430/e430 39/88 pwm/timers alternate functions the pins of port a and c can be configured to be i/ o of the three pwm/timers available on the st52x430. the configuration of these pins is performed by using the configuration registers reg_conf 12 and reg_conf 16 if the related pin has to be output. when the related pin has to be used as an input peripheral the configuration is performed by the relative peripheral configuration registers (see pwm/timer session). table 6.8 pwm/timers reg_conf 16 bit name value description 0 pc1 1 pin t0out/pc1 is configured as port c digital i/o 0 pin t0out/pc1 is configured as pwm/ timer 0 output t0out 1 pc2 1 pint1out/pc2 is configured as port c digital i/o 0 pin t1out/pc2 is configured as pwm/ timer 1 output t1out 2 pc3 1 pin t2out/pc3 is configured as port c digital i/o 0 pin t2out/pc3 is configured as pwm/ timer 2 output t2out 3 pc4 1 pin tx/pc4 is configured as port c digital i/o 0 pin tx/pc4 is configured as sci output tx 4-7 nc x not used reset configuration 1111 table 6.9 pwm/timers reg_conf 12 bit name value description 0pa1 1 pin pa1/t0out is configured as pwm/timer 0 complementary output 0 pin pa1/t0out is configured as port a digital i/o 1pa2 1 pin pa2/t1out is configured as pwm/timer 1 complementary output 0 pin pa2/t1out is configured as port a digital i/o 2pa3 1 pin pa3/t2out is configured as pwm/timer 2 complementary output 0 pin pa3/t2out is configured as port a digital i/o 3pasz 1 port a bits = 8 0 port a bits = 7 4-7 nc x not used reset configuration 0000
st52t430/e430 40/88 figure 6.3 configuration register 12 figure 6.4 configuration register 16 d7 d6 d5 d4 d3 d2 d1 d0 pa1t: pin pa1/t0out setting not used reg_conf 12 digital port pa2t: pin pa2/t1out setting pa3t: pin pa3/t2out setting pa78: port a size d7 d6 d5 d4 d3 d2 d1 d0 p6sl: pin t0out/pc1setting not used reg_conf 16 digital port p7sl: pin t1out/pc2 setting p8sl: pin t2out/pc3 setting p9sl: pin tx/pc4 setting
st52t430/e430 41/88 7 fuzzy computation (dp) the st52t430/e430 decision processor (dp) main features are: n up to 8 inputs with 8-bit resolution; n 1 kbyte of program/data memory available to store more than 300 to membership functions (mbfs) for each input; n up to 128 outputs with 8-bit resolution; n possibility of processing fuzzy rules with an unlimited number of antecedents; n unlimited number of rules and fuzzy blocks. the limits on the number of fuzzy rules and fuzzy program blocks are only related to the program/data memory size. 7.1 fuzzy inference the block diagram shown in figure 7.1 describes the different steps performed during a fuzzy algorithm. the st52t430/e430 core allows for the implementation of a mamdani type fuzzy inference with crisp consequents. inputs for fuzzy inference are stored in 8 dedicated fuzzy input registers. the ldfr instruction is used to set the input fuzzy registers with values stored in the register file. the result of a fuzzy inference is stored directly in a location of the register file. 7.2 fuzzyfication phase in this phase the intersection (alpha weight) between the input values and the related mbfs (figure 7.2) is performed. eight fuzzy input registers are available for fuzzy inferences. figure 7.1 fuzzy inference figure 7.2 alpha weight calculation after loading the input values by using the ldfr assembler instruction, the user can start the fuzzy inference by using the fuzzy assembler instruction. during fuzzyfication: input data is transformed in the activation level (alpha weight) of the mbfs. 7.3 inference phase the inference phase manages the alpha weights obtained during the fuzzyfication phase to compute the truth value ( w ) for each rule. this is a calculation of the maximum (for the or operator) and/or minimum (for the and operator) performed on alpha values according to the logical connectives of fuzzy rules. several conditions may be linked together by linguistic connectives and/or, not operators and brackets. the truth value w and the related output singleton are used by the defuzzyfication phase, in order to complete the inference calculation. 11 1m n1 nm fuzzyfication inference phase defuzzyfication n rules n rules -1 2 1 input values output values 1 a ij j-th mbf i-th input variable
st52t430/e430 42/88 figure 7.3 fuzzyfication 7.4 defuzzyfication in this phase the output crisp values are determined by implementing the consequent part of the rules. each consequent singleton x i is multiplied by its weight values w i , calculated by the decision processor, in order to compute the upper part of the defuzzyfication formula. each output value is obtained from the consequent crisp values (x i ) by carrying out the following defuzzyfication formula: where: i = identifies the current output variable n = number of the active rules on the current output w ij = weight of the j-th singleton x ij = abscissa of the j-th singleton the decision processor outputs are stored in the ram location i-th specified in the assembler instruction out i. 7.5 input membership function the decision processor allows the management of triangular mbfs. in order to define an mbf, three different parameters must be stored on the program/data memory (see figure 7.4): n the vertex of the mbf: v ; n the length of the left semi-base: lvd ; n the length of the right semi-base: rvd ; in order to reduce the size of the memory area and the computational effort the vertical range of the vertex is fixed between 0 and 15 (4 bits) by using the previous memorization method different kinds of triangular membership functions may be stored. figure 7.5 shows some examples of valid mbfs that can be defined in st52t430/ e430. each mbf is then defined storing 3 bytes in the first kbyte of the program/data memory. the mbf is stored by using the following instruction: mbf n_mbf lvd v rvd where: n_mbf is a tag number that identifies the mbf lvd , v , and rvd are the parameters that describe the mbfs shape as described above. figure 7.4 mbfs parameters input 1 x1 a 1 input 2 x2 a2 or = max if input 1 is x1 or input 2 is x2 then ....... input 1 x1 a 1 input 2 x2 a2 if input 1 is x1 and input 2 is x2 then ...... . y i x ij w ij j n ? w ij j n ? --------------------- = x 15 lvd rvd v 15 0 0 input mbf output singleton output variable input variable w
st52t430/e430 43/88 figure 7.5 example of valid mbfs 7.6 output singleton the decision processor uses a particular kind of membership function called singleton for its output variables. a singleton doesnt have a shape, like a traditional mbf, and is characterized by a single point identified by the couple (x, w), where w is calculated by the inference unit as described earlier. often, a singleton is simply identified with its crisp value x. figure 7.6 output membership functions 7.7 fuzzy rules rules can have the following structures: if a op b op c...........then z if (a op b) op (c op d op e...) ...........then z where op is one of the possible linguistic operators (and/or) in the first case the rule operators are managed sequentially; in the second one, the priority of the operator is fixed by the brackets. each rule is codified by using an instruction set, the inference time for a rule with 4 antecedents and 1 consequent is about 3 microseconds at 20 mhz. the assembler instruction set used to manage the fuzzy operations is reported in the table below. 1 i-th output 0 x ij x i0 x in w i0 w ij w in j-th singleton table 7.1 fuzzy instructions set instruction description mbf n_mbf ivd v rvd stores the mbf n_mbf with the shape identified by the parameters ivd , v and rvd ldp n m fixes the alpha value of the input n with the mbf m and stores it in internal registers ldn n m calculates the complementary alpha value of the input n with the mbf m . and stores the result in internal registers fzand implements the fuzzy operation and between the last two values stored in internal registers fzor implements the fuzzy operation or between the last two values stored in internal registers ldk stores the result of the last fuzzy operation executed in internal registers skm loads the result of the last performed fuzzy operation (stored in the temporary register k) in the temporary buffer m. ldm copies the value of register m in the data stack con crisp multiplies the crisp value with the last w weight out n_out performs defuzzyfication and stores the currently fuzzy output in the ram n_out location fuzzy starts the fuzzy algorithm
st52t430/e430 44/88 example 1 : if input 1 is not mbf 1 and input 4 is mbf 12 or input 3 is mbf 8 then crisp 1 is codified by the following instructions: example 2 , the priority of the operator is fixed by the brackets: if (input 3 is mbf 1 and input 4 is not mbf 15 ) or (input 1 is mbf 6 or input 6 is not mbf 14 ) then crisp 2 at the end of the fuzzy rule, by using the instruction out ram_reg , a byte is written. afterwards, the control of the algorithm returns to the cu. ldn 1 1 calculates the not a value of input 1 with mbf 1 and stores the result in internal registers ldp 4 12 fixes the a value of input 4 with mbf 12 and stores the result in internal registers fzand implements the operation and between the results obtained with the previous instructions ldk stores the result of the previous operation in internal dpu registers ldp 3 8 fixes the a value of input 3 with mbf 8 and stores the result in internal registers fzor implements the operation or between the results obtained with the previous instructions con crisp 1 multiplies the result of the last w operation with the crisp value crisp 1 ldp 3 1 fixes the a value of input 3 with mbf 1 and stores the result in internal registers ldn 4 15 calculates the not a value of input 4 with mbf 15 and stores the result in internal registers fzand implements the operation and between the results obtained with the previous instructions skm stores the result of the previous operation in register m ldp 1 6 fixes the a value of input 1 with mbf 6 and stores the result in internal registers ldn 2 14 calculates the not a value of input 6 with mbf 14 and stores the result in internal registers fzor implements the operation or between the results obtained with the previous instructions ldk stores the result of the previous operation in internal dpu registers ldm copies the value of the register m in internal dpu registers fzor implements the operation or between the last two values stored in dpu registers con crisp 2 multiplies the result of the last w operation with the crisp value crisp 2
st52t430/e430 45/88 8 a/d converter 8.1 introduction the a/d converter of st52x430 is an 8-bit analog to digital converter with up to 8 analog inputs offering 8 bit resolution with a total accuracy of 1 lsb and a typical conversion time of 8.2 m s with a 20 mhz clock. this period also includes the 5.1 m s of the integral sample and hold circuitry, which minimizes the need for external components and allows quick sampling of the signal for a minimum warping effect and integral conversion error. conversion is performed in 82 a/d clock pulses. the a/d clock is derived from the clock master. the maximum a/d clock frequency has to be 10 mhz. when the master clock is higher than 10 mhz it has to be divided by 2 using the sck bit of the a/d configuration register reg_conf 3 (see table 8.1). the a/d peripheral converts the input voltage with a process of successive approximations using a fixed clock frequency derived from the oscillator. the conversion range is between the analog v ss and v dd references. the converter uses a fully differential analog input configuration for the best noise immunity and figure 8.1 a/d converter structure precision performance, along with one separate supply (v dda ), allowing the best supply noise rejection. up to 8 multiplexed analog inputs are available. a group of signals can be converted sequentially by simply programming the starting address of the last analog channel to be converted. single or continuous conversion mode are available. the result of the conversion is stored in an 8-bit input register (from ir 1 to ir 8). the a/d converter is controlled via the configuration register reg_conf 3. a power-down programmable bit allows the a/d converter to be set to a minimum consumption idle status. the st52x430 interrupt unit provides one maskable channel for the end of conversion (eoc). 8.2 operational description the conversion is monotonic, meaning that the result never decreases if the analog input doesnt and never increases if the analog input doesnt. if input voltage is greater than or equal to v dda (voltage reference high) then the result is equal to ffh (full scale) without an overflow indication. pb0/ain0 pb1/ain1 pb2/ain2 pb3/ain3 pb7/pa7/ain7 pb6/ain6 pb5/ain5 pb4/ain4 analog mux successive approxmation a/d converter a/d channel 7 a/d channel 6 a/d channel 5 a/d channel 4 a/d channel 3 a/d channel 2 a/d channel 1 a/d channel 0 input register 1 ? 8 sample hold & ch2 ch1 ch0 sck seq pow lp str configuration register 3 control logic
st52t430/e430 46/88 if input voltage is less than v ss (voltage reference low) then the result is equal to 00h. the a/d converter is linear and the digital result of the conversion is provided by the following formula: where reference voltage is v dda - v ss . the accuracy of the conversion is described in the electrical characteristics section. the a/d converter is not affected by the wait mode. when the mcu enters halt mode with a/d converter enabled, the converter is disabled until halt mode is terminated and the start-up delay has elapsed. a stabilization period is also required before accurate conversions can be performed. figure 8.2 conf. register (reg_conf 3) 8.2.1 operating modes. four main operating modes can be selected by setting the values of the lp and seq bit in the a/d configuration register. one channel single mode in this mode ( seq = 0, lp = 0 ) the a/d provides an eoc signal after the end of channel i-th conversion; then the a/d waits for a new start event. channel i-th is identified by the bit ch0, ch1, ch2. i.e ch(2:0) = 011 means conversion of channel 3 then stop. multiple channels single mode in this mode ( seq = 1, lp = 0 ) the a/d provides an eoc signal after the end of the channels sequence conversion identified by the bit ch0, ch1, ch2; then the a/d waits for a new start event. i.e. ch(2:0) = 011 means conversion of channels 0,1,2 and 3 then stop. digitalresult 255 inputvoltage referencevoltage ----------------------------------------------- - = d 7 d0 ch2 ch1 ch0 sck seq pow lp str reg_conf 3 start/stop conversion mode sel. on/off a/d conversion mode sel. clock selector channels sel.
st52t430/e430 47/88 one channel continuous mode in this mode ( seq = 0, lp = 1 ) a continuous conversion flow is entered by a starting event on the channel selected by the ch0, ch1, ch2 bits for example: ch(2:0) = 011 means continuous conversion of channel 3. at the end of each conversion the relative ir is updated with the last conversion result, while the former value is lost. to stop the conversion str has to be set to 0 . multiple channels continuous mode in this mode ( seq = 1, lp = 1 ) a continuous conversion flow is entered by a starting event on the channels selected by the ch0, ch1, ch2 bits. i.e ch(2:0) = 011 means continuous conversion of channel 0,1,2 and 3. at the end of each conversion the relative irs are updated with the last conversion results, while the former values are lost. to stop the conversion str has to be set to 0. 8.2.2 power down mode. before enabling any a/d operation mode, set the pow bit of the a/d configuration register to 1 at least 60 m s before the first conversion starts to enable the biasing circuit inside the analog section of the converter. clearing the pow bit (pow = 0) is useful when the a/d is not used, reducing the total chip power consumption. this state is also the reset configuration and it is forced by hardware when the core is in halt state (after a halt instruction execution). 8.3 a/d registers description the result of the conversions of the 8 available channels are loaded in the 8 input register from decimal address 1 to decimal address 8. (ir (1:8) see table 2.2)). every ir(1:8) is reloaded with a new value at the end of the conversion of the correspondent analog input. by using the assembler instruction: ldri ram_reg. ir_i the value stored in the i-th ir is transferred on the ram location ram_reg. the a/d configuration register is the reg_conf 3. figure 6.2 illustrates the structure of this register, which manages the a/d logic operation. the a/d configuration register (reg_conf 3) is programmable as following: b7-b5 = ch2, ch1, ch0 : last conversion address. these 3 bits define the last analog input. the first analog input is converted, then the address is incremented for the successive conversion until the channel identified by ch0- ch2 is converted. the (ch2, ch1, ch0) bits define the group of channels to be scanned. when setting ch2=0 ch1=0 ch0=0 only channel 0 is converted. b4 = sck : master clock divider. st52x430 can work with a clock frequency up to 20 mhz. the sck must be set to 1 when the st52x430 clock is higher then 10 mhz. it is useful to set sck = 1 even when the clock master is lower than 10 mhz and a high accuracy is required. b3 = seq : multiple/single channel. when seq is set to 0 the channel identified by ch(2:0) is converted. if seq is set to 1 the group of channels identified by ch(2:0) are converted. b2= pow : power up/ power down. a logical 1 enables the a/d logic and analog circuitry. logical level 0 disables all power consuming logic, allowing a low power idle status. b1 = lp : continuous/single. when this bit is set to 1 (continuous mode), the first conversion sequences are started by the str bit then a continuous conversion flow is processed. when lp=0 (single mode) only one sequence of conversions is started when str is set. b0 = str : start/stop. a logical level 1 enables starting a conversion sequence; a logical level 0 stops the conversion. when the a/d is running in the single modes (lp=0), this bit is hardware reset at the end of a conversion sequence. table 8.1 a/d conf. register (reg_conf 3) bit name value description 0 str 0 stop conversion 1 start conversion 1lp 0 single conversion 1 continuous 2pow 0 a/d off 1 a/d on 3 seq 0 single channel conv. 1 multiple channels conv 4 sck 0 clock not divided 1 clock divided 5 ch(2:0) 000 channel 0 001 channel 1 010 channel 2 6 011 channel 3 100 channel 4 7 101 channel 5 110 channel 6 111 channel 7
st52t430/e430 48/88 9 watchdog timer 9.1 operational description the watchdog timer (wdt) is used to detect the occurrence of a software fault, usually generated by external interference or by unforeseen logical conditions, which cause the application program to abandon its normal sequence. the wdt circuit generates an mcu reset on expiry of a programmed time period, unless the program refreshes the wdt before the end of the programmed time delay. 16 different delays can be selected by using the wdt configuration register. after the end of the delay programmed by the configuration register if the wdt is activated (by using the assembler instruction wdtsfr), it starts a reset cycle pulling the reset pin low. once the wdt has been activated the application program has to refresh this peripheral (by the wdtsfr instruction) at regular intervals during normal operation in order to prevent an mcu reset. in order to stop the wdt during user program execution the instruction wdtslp has to be used. figure 9.1 watchdog block diagram the working frequency of the wdt (pres clk in the figure 9.1) is equal to the clock master. the clock master is divided by 500, obtaining the wdt clk signal, which is used to fix the timeout of the wdt. according to the wdt configuration register values, a wdt delay may be defined between 0.1 ms and 937.5 ms when the clock master is 5 mhz. by changing the clock master frequency the timeout delay can be calculated according to the configuration register values reg_conf 2, as described in the following section. warning: changing the reg_conf2 value when the wdt is active, a wdt reset is generated and the cpu is restarted. to avoid this side effect, use the wdtslp instruction before changing the reg_conf2. table 9.1 watchdog timing range (clk=5 mhz) wdt timeout period (ms) min 0.1 max 937.5 d0 d1 d2 d3 reg_conf 2 reset wdtrfr pres clk = clk master wdtslp prescaler wdt reset generator reset wtd clk
st52t430/e430 49/88 9.2 register description the wdt timeout is defined by setting the value of the reg_conf 2. the first 4 bits of this register are used, obtaining 16 different delays as illustrated in table 9.2. in table 9.2 timeout is expressed by using the number of wdt clk. the wdt clk is derived from the clock master by a division factor of 500. timeout is obtained by multiplying the wdt clk pulse length for the number of pulses defined by the configuration register reg_conf 2. table 9.4 illustrates the pulse lengths for typical values of the clock master. table 9.3 illustrates the timeout wdt values when the master clock is 5 mhz. table 9.2 wdt reg_conf 2 bit name value timeout values (wdt 0 d(3:0) 0000 1 0001 625 0010 1250 0011 1875 1 0100 2500 0101 3125 0110 3750 0111 4375 2 1000 5000 1001 5625 1010 6250 1011 6875 3 1100 7500 1101 8125 1110 8750 1111 9375 4-7 nc x not used reset configuration 0000 table 9.3 timeout values with clk = 5 mhz bit name value timeout values (ms) 0 d (3:0) 0000 0.1 0001 62.5 0010 125 0011 187.5 1 0100 250 0101 312.5 0110 375 0111 437.5 2 1000 500 1001 562.5 1010 625 1011 687.5 3 1100 750 1101 812.5 1110 875 1111 937.5 4-7 nc x not used reset configuration 0000 table 9.4 typical wdt clk pulse length master clk (mhz) wdt clk (khz) wdt clk pulse length (ms) 4 8 0.125 5 10 0.1 8 16 0.0625 10 20 0.05 20 40 0.025
st52t430/e430 50/88 10 pwm/timer st52x430 offers three on-chip pwm/timer peripherals:timer0, timer1 and timer2. the st52x430 timers have the same internal structure. the timer consists of an 8-bit counter with a 16-bit programmable prescaler, giving a maximum count of 2 24 (see figure 10.1). figure 10.1 timer peripheral block diagram next, the generic timer is called timer x, where x can be 0, 1 or 2. each timer has two different working modes, which can be selected by setting the correspondent txmode bits of reg_conf5, reg_conf8 and reg_conf10 registers: timer mode and pwm (pulse width modulation) mode. all timers have autoreload functions in pwm mode. each timer output is available, with its complementary signal on external pins by setting pax and pcx bits of reg_conf12 and reg_conf16 (see table 10.8 and table 10.9). note: in order to enable timer output (txout or txout ) the related pin must be configured in output mode by setting reg_conf4 and reg_conf15 registers (see table 6.4 and table 6.6) in particular, timer0 can also use external start/stop signals (input capture and output compare), external reset signal and external clock: pa4/t0strt, pa0/t0res and pa5/ t0clk pins. note: in order to use t0rst, t0str, t0clk external signals the related pins must be configured in input mode by setting reg_conf4 and reg_conf7 registers (see table 6.4 and table 10.3) for each timer, the content of the 8-bit counter is incremented on the rising edge of the 16-bit prescaler output (prescout) and it can be read at any instant of the counting phase, saved in a location of ram memory. the pwm/timer x counter value can be read from the input register pwm_x_count (input registers 12, 14 or 16. see table 2.2). the pwm/timer x status can be read from the input register pwm_x_status (input registers 13, 15 or 17. see table 2.2 and table 10.10). 10.1 timer mode timer mode is selected by fixing the txmode bit of reg_conf5, reg_conf8 and reg_conf10 equal to 0 (see table 10.1, table 10.4 and table 10.6). each timerx requires three signals: timer clock (tmrclkx), timer reset (txres) and timer start (txstrt) (see figure 10.1). each of these signals can be generated internally, or, only for timer 0, externally by setting t0rst, t0str, t0clk bits of reg_conf7 register. tmrclkx is the prescaler x output, which increments the counter x value on the rising edge. tmrclkx is obtained from the internal clock signal (clkm) or, only for timer0, from the external signal provided on the pa5/t0clk pin. bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 14 bit 15 bit 3 bit 0 bit 1 bit 2 bit 6 bit 4 bit 5 bit 7 17 - 1 multiplexer 16-bit prescaler 8- bi t counter prescx clkm tmrclk txres txstrt
st52t430/e430 51/88 figure 10.2 timer 0 external start/stop mode note: the external clock signal applied on the t0clk pin must have a frequency at least two times smaller than the internal master clock. the prescaler output can be selected by setting the prescx bit of reg_conf6, reg_conf9 and reg_conf11 registers (see table 10.2, table 10.5 and table 10.7). txres resets the content of the 8-bit counter x to zero. it is generated by the tirstx and txmsk bits of reg_conf5, reg_conf7, reg_conf8 and reg_conf10 registers (see table 10.1, table 10.3, table 10.4 and table 10.6). txstrt signal starts/stops timer x counting only if the peripherals are configured in timer mode. this signal is forced by setting the correspondent tistrx bit of reg_conf5, reg_conf8 and reg_conf10 registers (see table 10.1, table 10.4 and table 10.6). txmsk bits mask the reset of each timer and can be utilized to synchronize a simultaneous start of the timers by means (for example), of the following procedure, which starts three timers: 1) tirst0 = tirst1 = tirst2 = 0, 2) tistr0 = tistr1 = tistr2 = 0, 3) t0msk = t1msk = t2msk = 1, 4) tirst0 = tirst1 = tirst2 = 1, 5) tistr0 = tistr1 = tistr2 = 1, 6) t0msk = t1msk = t2msk = 0, when txmsk is 1 the timer x is reset. htfgdhtdfhfd figure 10.3 timerout signal type timer 0 start/stop can be provided externally on the t0strt pin. in this case, the t0strt signal allows the user to work in two different modes by setting the testr configuration bit of reg_conf5 register (see figure 10.2) (input capture): level (time counter) : if the t0strt signal is high the timer starts counting. when t0strt is low the counting ceases and the current value is stored in the pwm_0_count input register. level edge start stop start start stop start 01 1 0 4 4 3 2 reset clock counted value timer output type 1 type 2 prescout*counter
st52t430/e430 52/88 figure 10.4 pwm mode with auto reload edge(period counter) : after reset, on the first t0strt rising edge, timer 0 starts counting and at the next rising edge it stops. in this manner, the period of an external signal may be measured. timer x output signal, timerxout is a signal with a frequency equal to the 16 bit-prescaler x output signal, tmrclkx, divided by the output register pwm_x_count value (8 bit) (output registers 3, 5 or 7. see table 2.4), which is the value to count. there can be two types of timerxout waveform: type 1: timerxout waveform equal to a square wave with a 50% duty-cycle. type 2: timerxout waveform equal to a pulse signal with the pulse duration equal to the prescaler x output signal. for each timer x, the timerxout waveform type can be selected by setting the correspondent tmrwx bit of reg_conf6, reg_conf9 and reg_conf11 registers (see table 10.2, table 10.5 and table 10.7) 10.2 pwm mode for each timer, pwm working mode is obtained by setting the correspondent txmode bits of reg_conf5, reg_conf8 and reg_conf10 registers to 1 (see table 10.1, table 10.4 and table 10.6). timerxout, in pwm mode consists of a signal with a fixed period, whose duty cycle can be modified by the user. the timerxout signal can be available on the txout pin and the timerxout inverted signal can be available on the txout pin by setting the pxsl bits of reg_conf12 and reg_conf16 (see table 10.8 and table 10.9) the pwm timerxout period can be determined by setting the 16-bit prescaler x output and an initial autoreload 8-bit counter value stored in the output register pwm_x_reload, as illustrated in figure 10.4. note: the start/stop and set/reset signals should be moved together in pwm mode. if the start/stop bit is reset during the pwm mode working, the txout signal keeps its status until the next start. t t 255 compare value reload register 0 pwm output ton t
st52t430/e430 53/88 the output register pwm_x_reload value is automatically reloaded when counter x restarts counting. the 16-bit prescaler x divides the master clock, clkm, or, only for timer0, the external t0clk signal, by the 16-bit prescaler x. note: the external clock signal, applied on t0clk pin must have a frequency at least two times smaller than the internal master clock. the prescaler x output can be selected by setting prescx bit of reg_conf6, reg_conf9 and reg_conf11 registers (see table 10.2, table 10.5 and table 10.7). when counter x reaches the peripheral register pwm_x_count value (compare value), timerxout signal changes from high to low level, up to the next counter start. the period of the pwm signal is obtained by using the following equation: t = (255 - pwm _x_reload)x tmr clkx where tmrclkx is the output of the 16-bit prescaler x. the duty cycle of the pwm signal is controlled by the output register pwm_x_count: ton =(pwm_x_count- pwm_x_reload)* tmrclkx if the output register pwm_x_count value is 255 the timerxout signal is always at a high level. if the output register pwm_x_count is 0, or less than the pwm_x_reload value, timerxout signal is always at a low level. note. if pwm_x_reload value increases the duty cycle resolution decreases. by using a 20 mhz clock master a pwm frequency in the range 1.2 hz to 78.43 khz can be obtained. note: loading new values of the counter in the pwm_x_count register, in order to avoid side effects, the pwm/timer counter is updated only at the end of the counting cycle. warning: loading new values of the reload in the pwm_x_reload registers, the pwm/timer is immediately set on-fly. this can cause some side effects during the current counting cycle. the next cycles work normally. this occurs both in timer and in pwm mode. when the timers are in reset, or when the device is reset, txout pins go in threestate. if these outputs are used to drive external devices it is recommended to put a pull-up or a pull-down resistor. 10.3 timer interrupt timerx can be programmed to generate an interrupt request until the end of the count or when there is an external tstart signal. the timer can generate programmable interrupts into 4 different modes: interrupt mode 1 : interrupt on counter stop. interrupt mode 2 : interrupt on rising edge of timerout. interrupt mode 3 : interrupt on falling edge of timerout. interrupt mode 4 : interrupt on both edges of timerout. interrupt mode can be selected by means of intslx and intex bits of the reg_conf5, reg_conf8 and reg_conf10 registers (see table 10.1, table 10.4 and table 10.6). note: the interrupt on timerout rising edge is also generated after the start. warning: the first interrupt after starting pwm is not generated if the counter value is 0, 255, or lower than the reload value. if the pwm/ timer is configured with the interrupt on stop and the start/stop is configured as external, a low signal in the strt pin determines a pwm/ timer interrupt even if the peripheral is off. if the interrupt is configured on falling edge, a reset signal generates an interrupt request.
st52t430/e430 54/88 figure 10.5 configuration register 5 table 10.1 configuration register 5 description bit name value description 0 tirst0 0 pwm/timer 0 internal reset 1 pwm/timer 0 internal set 1 terst 0 external reset on level 1 external reset on edge 2 tistr0 0 pwm/timer 0 internal stop 1 pwm/timer 0 internal start 3 testr 0 external start on level 1 external start on edge 4 inte0 00 timer0 interrupt on timer interrupt on timerout falling edge 01 timer0 interrupt on timer0out rising edge 5 10 timer0 interrupt on both edges of timer0out 11 - not used 6 intsl0 0 timer0 interrupt on counter stop 1 timer0 interrupt on timer0out 7 t0mode 0 timer mode 1 pwm mode d7 d6 d5 d4 d3 d2 d1 d0 tirst0: timer 0 internal reset terst: timer 0 external reset on edge/level tistr0: timer 0 internal start testr: timer 0 external start on edge/level inte0: timer 0 interrupt on timer0out rising/falling edge intsl0: timer 0 interrupt source selection t0mode: timer 0 working mode reg_conf 5 timer 0
st52t430/e430 55/88 figure 10.6 configuration register 6 table 10.2 configuration register 6 description bit name value description 0 presc0 00000 timer0 clock = clkm / 1 00001 timer0 clock = clkm / 2 00010 timer0 clock = clkm / 4 00011 timer0 clock = clkm / 8 1 00100 timer0 clock = clkm / 16 00101 timer0 clock = clkm / 32 00110 timer0 clock = clkm / 64 2 00111 timer0 clock = clkm / 128 01000 timer0 clock = clkm / 256 01001 timer0 clock = clkm / 512 3 01010 timer0 clock = clkm/1024 01011 timer0 clock = clkm/2048 01100 timer0 clock = clkm/4096 4 01101 timer0 clock = clkm/8192 01110 timer0 clock=clkm/16384 01111 timer0 clock=clkm/32768 10000 timer0 clock=clkm /65536 5 tmrw0 0 timer0out waveform equal to pulse wave 1 timer0out waveform equal to square wave 6 - - - not used 7 - - - not used d7 d6 d5 d4 d3 d2 d1 d0 presc0: timer 0 prescaler tmrw0: timer0out waveform not used reg_conf 6 timer 0
st52t430/e430 56/88 figure 10.7 configuration register 7 table 10.3 configuration register 7 description bit name value description 0 t0rst 00 timer0 reset internal 01 timer0 reset external 1 10 timer0 reset external or internal 11 - not used 2 t0str 00 timer0 start internal 01 timer0 start external 3 10 timer0 start external or internal 11 - not used 4 t0clk 0 timer0 clock internal 1 timer0 clock external 5 t0msk 0 timer 0 reset synchronization mask. 1 timer0 reset synchronization mask. 6 t2msk 0 timer2 reset synchronization mask. 1 timer2 reset synchronization mask. 7 t1msk 0 timer1 reset synchronization mask. 1 timer1 reset synchronization mask. d7 d6 d5 d4 d3 d2 d1 d0 t0rst: timer 0 reset mode t0str: timer 0 start mode t0clk: timer 0 clock source t0msk: timer 0 reset mask t2msk: timer 2 reset mask t1msk: timer 1 reset mask reg_conf 7 timer 0, timer 1, timer2
st52t430/e430 57/88 figure 10.8 configuration register 8 table 10.4 config. register 8 description bit name value description 0 tirst1 0 pwm/timer 1 internal reset 1 pwm/timer 1 internal set 1 - - - not used 2 tistr1 0 pwm/timer 1 internal stop 1 pwm/timer 1 internal start 3 - - - not used 4 inte1 00 timer1 interrupt on timer1out falling edge 01 timer1 interrupt on timer1out rising edge 5 10 timer1 interrupt on both edges of timer1out 11 - not used 6 intsl1 0 timer1 interrupt on counter stop 1 timer1 interrupt on timer1out 7 t1mode 0 timer mode 1 pwm mode d7 d6 d5 d4 d3 d2 d1 d0 tirst1: timer 1 reset - not used tistr1: timer 1 start - not used inte1: timer 1 interrupt on timer1out rising/falling edge intsl1: timer 1 interrupt source selection t1mode: timer 1 working mode reg_conf 8 timer 1
st52t430/e430 58/88 figure 10.9 configuration register 9 table 10.5 config. register 9 description bit name value description 0 presc1 00000 timer1 clock = clkm / 1 00001 timer1 clock = clkm / 2 00010 timer1 clock = clkm / 4 00011 timer1 clock = clkm / 8 1 00100 timer1 clock = clkm / 16 00101 timer1 clock = clkm / 32 00110 timer1 clock = clkm / 64 2 00111 timer1 clock = clkm / 128 01000 timer1 clock = clkm / 256 01001 timer1 clock = clkm / 512 3 01010 timer1 clock =clkm / 1024 01011 timer1 clock =clkm / 2048 01100 timer1 clock =clkm / 4096 4 01101 timer1 clock =clkm / 8192 01110 timer1 clock =clkm/16384 01111 timer1 clock=clkm /32768 10000 timer1 clock=clkm /65536 5 tmrw1 0 timer1out waveform equal to pulse wave 1 timer1out waveform equal to square wave 6 - - - not used 7 - - - not used d7 d6 d5 d4 d3 d2 d1 d0 presc1: timer 1 prescaler tmrw1: timer1out waveform not used reg_conf 9 timer 1
st52t430/e430 59/88 figure 10.10 configuration register 10 table 10.6 config. register 10 description bit name value description 0 tirst2 0 pwm/timer 2 internal reset 1 pwm/timer 2 internal set 1 - - - not used 2 tistr2 0 pwm/timer 2 internal stop 1 pwm/timer 2 internal start 3 - - - not used 4 inte2 00 timer2 interrupt on timer2out falling edge 01 timer2 interrupt on timer2out rising edge 5 10 timer2 interrupt on both edges of timer2out 11 - not used 6 intsl2 0 timer2 interrupt on counter stop 1 timer2 interrupt on timer2out 7 t2mode 0 timer mode 1 pwm mode d7 d6 d5 d4 d3 d2 d1 d0 tirst2: timer 2 reset - not used tistr2: timer 2 start - not used inte2: timer 2 interrupt on timer2out rising/falling edge intsl2: timer 2 interrupt source selection t2mode: timer 2 working mode reg_conf 10 timer 2
st52t430/e430 60/88 figure 10.11 configuration register 11 table 10.7 config. register 11 description bit name value description 0 presc2 00000 timer2 clock = clkm / 1 00001 timer2 clock = clkm / 2 00010 timer2 clock = clkm / 4 1 00011 timer2 clock = clkm / 8 00100 timer2 clock = clkm / 16 00101 timer2 clock = clkm / 32 00110 timer2 clock = clkm / 64 2 00111 timer2 clock = clkm / 128 01000 timer2 clock = clkm / 256 01001 timer2 clock = clkm / 512 3 01010 timer2 clock = clkm /1024 01011 timer2 clock = clkm/ 2048 01100 timer2 clock = clkm/ 4096 4 01101 timer2 clock = clkm/ 8192 01110 timer2 clock= clkm/16384 01111 timer2 clock =clkm/32768 10000 timer2 clock =clkm/65536 5 tmrw2 0 timer2out waveform equal to pulse wave 1 timer2out waveform equal to square wave 6 - - - not used 7 - - - not used d7 d6 d5 d4 d3 d2 d1 d0 presc2: timer 2 prescaler tmrw2: timer2out waveform not used reg_conf 11 timer 2
st52t430/e430 61/88 figure 10.12 configuration register 12 table 10.8 config. register 12 description bit name value description 0pa1 0 pin pa1/t0out equal to port a digital i/o 1 pin pa1/ t0out equal to t0out 1pa2 0 pin pa2/ t1out equal to port a digital i/o 1 pin pa2/ t1out equal to t1out 2pa3 0 pin pa3/ t2out equal to port a digital i/o 1 pin pa3/ t2out equal to t2out 3pasz 0 port a bits = 7 1 port a bits = 8 4 - - - not used 5 - - - not used 6 - - - not used 7 - - - not used d7 d6 d5 d4 d3 d2 d1 d0 pa1: pin pa1/t0out setting not used reg_conf 12 digital port pa2: pin pa2/t1out setting pa3: pin pa3/t2out setting pasz: port a size
st52t430/e430 62/88 figure 10.13 configuration register 16 table 10.9 config. register 16 description bit name value description 0 pc1 1 pin t0out/pc1 equal to port c digital i/o 0 pin t0out/pc1 equal to t0out 1 pc2 1 pin t1out/pc2 equal to port c digital i/o 0 pin t1out/pc2 equal to t1out 2 pc3 1 pin t2out/pc3 equal to port c digital i/o 0 pin t2out/pc3 equal to t2out 3 pc4 1 pin tx/pc4 is configured as port c digital i/o 0 pin tx/pc4 is configured as sci output tx 4-7 - - - not used d7 d6 d5 d4 d3 d2 d1 d0 pc1: pin t0out/pc1setting not used reg_conf 16 digital port pc2: pin t1out/pc2 setting pc3: pin t2out/pc3 setting pc4: pin tx/pc4 setting
st52t430/e430 63/88 table 10.10 input registers 13. pwm_0_status bit name value description 0 str0 0 timer 0 is stop 1 timer 0 start 1 rst0 0 timer 0 is reset 1 timer 0 is not 2 - - - not used 3 - - - not used 4 - - - not used 5 - - - not used 6 - - - not used 7 - - - not used table 10.11 input registers 15. pwm_1_status bit name value description 0 str1s 0 timer 1 is stop 1 timer 1 is start 1 rst1s 0 timer 1 is reset 1 timer 1 is not 2 - - - not used 3 - - - not used 4 - - - not used 5 - - - not used 6 - - - not used 7 - - - not used table 10.12 input registers 17. pwm_2_status bit name value description 0 str2 0 timer 2 is stop 1 timer 2 is start 1 rst2 0 timer 2 is reset 1 timer 2 is not 2 - - - not used 3 - - - not used 4 - - - not used 5 - - - not used 6 - - - not used 7 - - - not used
st52t430/e430 64/88 11 serial communication interface the serial communication interface (sci) integrated into the st52x430 fuzzy processor provides a general purpose shift register peripheral, which links several widely distributed mcus through their sci subsystem. sci offers a serial interface providing communication with common baud rates up to 38,400 and flexible character format. sci is a full-duplex uart-type asynchronous system with standard non return to zero (nrz) format for the transmitted/received bit. the length of the transmitted word is 10/11 bits (1 start bit, 8/ 9 data bits, 1 stop bit). sci is composed of three modules: receiver, transmitter and baud-rate generator. it is configured by means of configuration registers 19 and 20. warning: in order to work properly with sci peripherals maintaining the desired baud rate a system clock of only 5, 10 or 20 mhz must be used. 11.1 sci receiver block the sci receiver block manages the synchronization of the serial data stream and stores data characters. the sci receiver is mainly formed by two sub-systems: recovery buffer block and scdr_rx block. figure 11.1 sci transmitted word structures the re configuration bit (bit 1 of the configuration register 20) enables the sci receiver when it is set to 1. sci receives data deriving from the rx/pc5 pin and drives the recovery buffer block, which is a high-speed shift register operating at a clock frequency (clock_rx) that is 16 times higher than the fixed baud rate (clock_tx). this sampling rate, higher than the baud rate clock allows the detection of the start condition, noise error and frame error. figure 11.2 sci block diagram sci ram scdr_tx ldpr 9 ram-i or ldpe 9 epr-i baud-rate generator ldri ram-i 18 shift register scdr_rx recovery buffer rx/pc5 tx/pc4 sci transmitter sci receiver mclk ram / eprom ir 18 or 9 7 6 5 432 10 8 9 7 6 5 43210 8 9 10 stop data start stop data start
st52t430/e430 65/88 when the sci receiver is in idle status, it is waiting for the start condition, which is obtained with a logic level 0, consecutive to a logic level 1. this condition is detected if a logic level 0 is sampled after three logic levels 1 with the fixed sampling time. the recognition of the start bit forces the sci receiver block to enter in a data acquisition sequence. the data acquisition sequence is configured via configuration register 20 as follows. the 2 bits, m, of the configuration register 20 allows the definition of the serial mode as illustrated in table 11.1. in the case that m=10, bit t8 is used to set the parity check in order to perform (as indicated in table 11.1). recognition of the stop condition allows data received from the recovery buffer to be transferred to the scdr_rx buffer, adding the eventual ninth data bit, according to the meaning illustrated in previous table 11.1. after this operation, the rxf flag of the sci status input register 19 (figure 11.3) is set to logic level 1. the control unit reads data from the scdr_rx buffer (in read-only mode) with the ldri instruction, addressing input register 18, and provides a reset at logic level 0 to the rxf flag. if data of the recovery buffer is ready to be transferred into the scdr_rx buffer, but the previous one was not read by the core yet, an overrun error takes place: the status flag overr indicates the error condition. in this case, the information stored in the scdr_rx buffer is not altered, but the one that has caused the overrun error can be overwritten by new data deriving from the serial data line. recovery buffer block this block is structured as a synchronized finite state machine on the clock_rx signal. when the recovery buffer block is in idle state it waits for the reception of the correct 1 and 0 sequence representing start. the recognition takes place by sampling the input rx/pc5 at clock_rx frequency, which has a frequency that is 16 times higher than clock_tx. while the external transmitter sends a single bit, the recovery buffer block samples 16 states (from sample1 to sample16). the analysis of the rx/pc5 input signal is carried out providing three samples for each bit received. if these three samples are not equal, then the noise error flag, nserr, of input register 19 is set to 1 and the data value received will be the one assumed by the majority of the samples. the procedure above allows sci not to become idle, because of a limited noise due to an erroneous sampling. the transmission is recognized as correct and the noise flag is set. at the end of the reception of a bit, recovery buffer block will repeat the same step 9 times: one for the stop acquisition (10 times in case of 9-bit data, double stop or parity check). at the end of data reception the recovery buffer block will supply information on eventual frame errors by setting the frerr flag bit of input register 19 to 1. table 11.1 configuration register 20 setting bit name value description 0te 0 transmission 1 transmission enabled 1re 0 receiver disabled 1 receiver enabled 2m 00 8, no parity, 1 bit stop 01 8, no parity, 2 bit stop 3 10 8, parity, 1 bit stop 11 9, no parity, 1 bit stop 4t8 0 parity odd, if parity is selected (m = 10); otherwise 9th data bit 1 parity even, if parity is selected (m = 10); otherwise 9th data bit 5 brsl 000 600 baud 001 1200 baud 010 2400baud 6 011 4800 baud 100 9600 baud 7 101 19200 baud 110 38400 baud 111 not used
st52t430/e430 66/88 a frame error can occur if the parity check hasnt been successfully achieved or if the stop bit hasnt been detected. if the recovery buffer block receives 10 consecutive bits at logic level 0, a break error occurs and an interrupt routine request starts. scdr_rx block it is a finite state machine synchronized with the clock master signal, ckm. the scdr_rx block waits for the signal of complete reception from the recovery buffer, in order to load the word received. moreover, the scdr_rx block loads the values of frerr and nserr flag bits (input register 19), and sets the rxf flag to 1. data is transferred to ram and the rxf flag is reset to 0 by using the ldri instruction in order to indicate that the scdr_rx block is empty. if new data arrives before the previous one has been transferred to register file, an overrun error occurs and overr flag of input register 19 is set to 1. 11.2 sci transmitter block the sci transmitter block consists of the following blocks: scdr_tx and shift register, synchronized, respectively, with the clock master signal (ckm) and the clock_tx. the whole block receives the settings for the following transmission modes (see table 11.1) through configuration register 20 (m bits): n 8-bit word and a single stop signal n 8-bit word plus a parity bit and a single stop signal n 8-bit word plus a double stop signal n 9-bit word in case of 9 bit frame transmission, the most significative bit arrives through t8 of the configuration register 20. instead, in an 8-bit transmission t8 is used to configure sci according to information contained in m (see table 11.1). in particular, it is used to choose the polarity control (even or odds) in order to implement the parity check. after a reset signal rst, the scdr_tx block is in idle state until it receives the enabling signal te=1, of configuration register 20. data is loaded on the peripheral register (or 9) by using the instruction lppr or ldpe. if te=1 the data to be transmitted is transferred from dr_tx block and flag of input register 19. txem is reset to 0 in order to indicate that the scdr_tx block is full. table 11.2 configuration register 19 setting bit name value description 0 - not used 1 eckf 00 5 mhz 01 10 mhz 2 10 20 mhz 11 5 mhz 3 txc 0 sci end transmission interrupt disabled 1 sci end transmission interrupt enabled 4 tdre 0 sci transmission data register empty interrupt disabled 1 sci transmission data register empty interrupt enabled 5 brk 0 sci break error interrupt disabled 1 sci break error interrupt enabled 6 ovr 0 sci overrun error interrupt disabled 1 sci overrun error interrupt enabled 7 rdrf 0 sci received data register full interrupt disabled 1 sci received data register full interrupt enabled
st52t430/e430 67/88 figure 11.3 sci status input register if the core supplies new data it cant be loaded in the scdr_tx block until the current data hasnt been unloaded on the shift register block. therefore, data may be loaded in the scdr_tx block only when txem is 1. when the shift register block loads data to be transmitted on an internal buffer, txend is reset to 0 in order to indicate the beginning of a new transmission. at the end of transmission txend is set to 1, allowing to load new data coming from scdr_tx in the shift register. note : txend = 1 does not mean scdr_tx is ready to receive new data. for this reason it is better to utilize the txem signal in order to synchronize the ldpr instruction to the sci transmitter block if the st52x430 core resets te to 0, the transmission is interrupted, but the sci transmitter block completes the transmission in progress before reset. warning : after the stop bit in sci transmission an idle time is present before the next start bit. this time is equal to the duration of a bit transmission. 11.3 baud rate generator block the baud rate generator block performs the division of the clock master signal (ckm), in a set of synchronism frequencies for the serial bit reception/transmission on the external line. table 11.1 illustrates the set of frequencies selected by means of brsl (configuration register 20). reception frequency (clock_rx) is 16 times higher than transmission frequency (clock_tx). the following example illustrates a simple way to use sci to receive and transmit data: ldrc 1 155 ldcr 20 1 these instructions load value 155 on the configuration register 20 fixing the baud rate=9600, 8 bit data, te=1, re=1; parity; 1 stop bit. ldrc 1 252 ldcr 19 4 sci interrupts enabled, clock frequency 20 mhz ldrc 1 170 ldpr 9 1 send data to transmission buffer waiti ldri 6 19 save the sci status register on the ram ldri 1 18 save the received data on a ram register d7 d6 d5 d4 d3 d2 d1 d0 sci_st input register 19 txend - end transmission txem - transmission data register empty r8 - received ninth bit nserr - noise error not used overr - overrun error rxf - receive data register full frerr - frame error
st52t430/e430 68/88 12 electrical characteristics 12.1 parameter conditions unless otherwise specified, all voltages are referred to v ss. 12.1.1 minimum and maximum values. unless otherwise specified, the minimum and maximum values are guaranteed in the worst conditions of environment temperature, supply voltage and frequencies production testing on 100% of the devices with an environmental temperature at t a =25 c and t a =t a max (given by the selected temperature range). data is based on characterization results, design simulation and/or technology characteristics are indicated in the table footnotes and are not tested in production. the minimum and maximum values are based on characterization and refer to sample tests, representing the mean value plus or minus three times the standard deviation (mean 3 s ). 12.1.2 typical values. unless otherwise specified, typical data is based on t a =25 c, v dd =5v (for the 4.5 v dd 5.5v voltage range). they are provided only as design guidelines and are not tested. 12.1.3 typical curves. unless otherwise specified, all typical curves are provided only as design guidelines and are not tested. figure 12.1 pin loading conditions 12.1.4 loading capacitor. the loading condition used for pin parameter measurement is illustrated in figure 12.1. 12.1.5 pin input voltage. input voltage measurement on a pin of the device is described in figure 12.2 figure 12.2 pin input voltage 12.2 absolute maximum ratings stresses above those listed as absolute maximum ratings may cause permanent damage to the device. this is a stress rating only. functional operation of the device under these conditions is not implied. exposure to maximum rating conditions for extended periods may affect device reliability. st52 pin c l st52 pin v in
st52t430/e430 69/88 table 12.1 voltage characteristics symbol ratings maximum value unit v dd -v ss supply voltage 6.5 v v dda -v ssa analog reference voltage(v dd 3 v dda )6.5 |d v dda | and |d v ssa | variation between different digital power pins 50 mv | v ssa -v ssx | variation between digital and analog ground pins 50 v in input voltage on vpp v ss -0.3 to 13 v input voltage on any other pin 1) & 2) v ss -0.3 to v dd +0.3 v desd electro-static discharge voltage 2000 table 12.2 current characteristics symbol ratings maximum value unit i vdd total current in v dd power lines (source) 3) 100 ma i vss total current in v ss ground lines (sink) 3) 100 i io output current sunk by any standard i/o and control pin 25 output current source by any i/os and control pin -25 i inj(pin) injected current on v pp pin 5 injected current on reset pin 5 injected current on oscin and oscout pins 5 injected current on any other pin 4) 5 s i inj(pin) total injected current (sum of all i/o and control pins) 4) 20 table 12.3 thermal characteristics symbol ratings maximum value unit t stg storage temperature range -65 to +150 c t j maximum junction temperature 150 c notes: 1. connecting reset and i/o pins directly to v dd or v ss could damage the device if the unintentional internal reset is generated or an unexpected change of i/o configuration occurs (for example, due to the corrupted program counter). in order to guarantee safe operation, this connection has to be performed via a pull-up or pull-down resistor (typical: 4.7k w for reset, 10k w for i/os). unused i/o pins must be tied in the same manner to v dd or v ss according to their reset configuration. 2. when the current limitation is not possible, the vin absolute maximum rating must be respected, otherwise refer to i inj(pin) specification. a positive injection is induced by v in >v dd while a negative injection is induced by v in vdd while a negative injection is induced by v in st52t430/e430 70/88 12.3 recommended operating condition operating condition: v dd =5v 10%; t a =0/125 c (unless otherwise specified). notes: 1. it is reccomendend to insert a capacitor beetwen v dd and v ss for improving noise rejection. rec- comended values are 10 m f (electrolytic or tantalum) and/or 100 nf (ceramic). 2. in order to use sci correctly maintaining the programmed baud rates, fosc must be set to 5, 10 or 20 mhz. 3. a lower v dd decreasing f osc (see figure 12.3). data illustrated in the figure are characterized but not tested. figure 12.3 fosc maximum operating frequency versus vdd supply table 12.4 recommended operating conditions symbol parameter test condition min. typ. max unit v dd 2) operating supply refer to figure 12.3 3.5 5.5 v v pp programming voltage 11.4 12 12.6 v o output voltage v ss v dd v dda, analog supply voltage v dd -0.3 v dd v dd +0.3 v ssa analog ground v ss -0.3 v ss v ss +0.3 f osc 1)2) oscillator frequency 2 20 mhz 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 0 2 4 6 8 10 12 14 16 18 20 functionality not guarateed in this area functionality not guarateed in this area functionality guarateed in this area vdd (v) f osc. max (mhz)
st52t430/e430 71/88 12.4 supply current characteristics supply current is mainly a function of the operating voltage and frequency. other factors such as i/o pin loading and switching rate, oscillator type, internal code execution pattern and temperature, also have an impact on the current consumption. the test condition in run mode for all the idd measurements are: oscin = external square wave, from rail to rail; oscout = floating; all i/o pins tristated pulled to vdd t a =90 c figure 12.4 typical idd in run vs fosc figure 12.5 typical idd in wait vs fosc table 12.5 supply current in run and wait mode symbol parameter conditions typ max 3) unit i dd supply current in run mode 1) v dd =5v 5% t a =90 c f osc =2 mhz 4.0 6.0 ma f osc =4 mhz 7.5 10.0 f osc =5 mhz, 9.0 12.0 f osc =10 17.5 20.0 f osc =20 33.5 37.0 supply current in wait mode 2) f osc =2 mhz 2.0 3.0 f osc =4 mhz 4.0 5.0 f osc =5 mhz 5.0 6.0 f osc =10 10.0 12.0 f osc =20 18.5 22.0 0 5 10 15 20 25 30 35 3.5 3.7 3.9 4.1 4.3 4.5 4.7 4.9 5.1 5.3 5.5 vdd [v] idd [ma] 2 mhz 4 mhz 5 mhz 10 mhz 20 mhz 0 2 4 6 8 10 12 14 16 18 20 3.5 3.7 3.9 4.1 4.3 4.5 4.7 4.9 5.1 5.3 5.5 vdd [v] idd [ma] 2 mhz 4 mhz 5 mhz 10 mhz 20 mhz notes: 1. cpu running with memory access, all i/o pins in input mode with a static value at v dd or v ss (no load), all peripherals switched off; clock input (oscin driven by external square wave). 2. cpu in wait mode with all i/o pins in input mode with a static value at v dd or v ss (no load), all peripherals switched off; clock input (oscin driven by external square wave). 3. data based on characterization results, tested in production at v ddmax and f oscmax .
st52t430/e430 72/88 notes: 1. typical data is based on ta = 25 c 2. all i/o pins in input mode with a static value at v dd or v ss (no load) notes: 3. typical data is based on t a =25 c, v dda =5 v. 4. data is based on characterization results and isnt tested in production. table 12.6 supply current in halt mode symbol parameter conditions typ 1) max unit i dda supply current in halt mode 2) 3.0 v vdd 5.5 v 1 10 m a table 12.7 on-chip peripheral symbol parameter conditions typ 3 max 4 unit i dda adc supply current when converting fosc=20mhz, v dda = 5 5% v, vssa = vss v ssa =v ss 12ma
st52t430/e430 73/88 12.5 clock and timing characteristics operating conditions: v dd =5v 5%, ta=0/125 c, unless otherwise specified figure 12.7 i/o rise and fall timing table 12.8 general timing parameters symbol parameters test condition min typ. max unit f osc oscillator frequency 1 20 mh t clh clock high 25 250 ns t cll clock low 25 250 t set setup see fig. 11.6 5 t hld hold see fig. 11.6 5 t wreset minimum reset pulse f osc =20mhz 100 t wint minimum external f osc =20mhz 100 t ir input rise time see fig. 11.7 15 t if input fall time see fig. 11.7 15 t or output rise time c load =10pf 10 t of output fall c load =10pf 10 figure 12.6 data input timing t cll t clh 50% 50% 50% t set t hld clock data cp t
st52t430/e430 74/88 12.6 memory characteristics subject to general operating conditions for v dd , f osc and t a , unless otherwise specified. notes: 1. minimum v dd supply voltage without losing data stored into ram (in halt mode or under reset) or into hardware registers (only in halt mode). guaranteed by construction, not tested in production. 2. data is provided only as a guideline. table 12.9 ram and registers symbol parameter conditions min. typ. max unit v rm data retention mode 1) halt mode (or reset) 1.6 v table 12.10 eprom program memory symbol parameter conditions min. typ. max unit w erase uv lamp lamp wavelength 2537 a 15 watt, sec/cm 2) t erase erase time 2) uv lamp is placed 1 inch from the device window without any interposed filters 15 20 min. t ret data retention t a =+55 c 20 years
st52t430/e430 75/88 12.7 esd pin protection strategy in order to protect an integrated circuit against electro-static discharge the stress must be controlled to prevent degradation or destruction of the circuit elements. stress generally affects the circuit elements, which are connected to the pads but can also affect the internal devices when the supply pads receive the stress. the elements that are to be protected must not receive excessive current, voltage, or heating within their structure. an esd network combines the different input and output protections. this network works by allowing safe discharge paths for the pins subject to esd stress. two critical esd stress cases are presented in figure 12.8 and figure 12.9 for standard pins. 12.7.1 standard pin protection in order to protect the output structure the following elements are added: - a diode to v dd (3a) and a diode from v ss (3b) - a protection device between v dd and v ss (4) in order protect the input structure the following elements are added: - a resistor in series with pad (1) - a diode to v dd (2a) and a diode from v ss (2b) - a protection device between v dd and v ss (4) figure 12.8 safe discharge path subjected to esd stress figure 12.9 negative stress on a standard pad vs. vdd out (4) in vdd vss vdd vss (2a) (2b) (3a) (3b) (1) main path path to avoid main path vss vdd out (3b) (4) in (3a) (2b) (1) vss (2a) vdd
st52t430/e430 76/88 12.7.2 multi-supply configuration. when several types of ground (v ss , v ssa ,...) and power supply (v dd , v dda ,...) are available for any reason (better noise immunity...), the structure illustrated in figure 12.10 is implemented in order to protect the device against esd. figure 12.10 esd protection for multisupply configuration vssa vdda vdda vdd vss (4) (4) back to back di ode between grounds
st52t430/e430 77/88 12.8 port pin characteristics 12.8.1 general characteristics. subject to general operating condition for v dd , f osc, and t a , unless otherwise specified. notes: 1. unless otherwise specified, typical data is based on t a =25 c and v dd =5 v 2. hysteresis voltage between schmitt trigger switching level. based on characterization results, not tested in production. 3. configuration is not recommended, all unused pins must be kept at a fixed voltage: using the output mode of the i/o for example or an external pull-up or pull-down resistor (see figure 12.11. data based on design simulation and/or technology characteristics is not tested in production. figure 12.11 recommended configuration for unused pins symbol parameter condition min typ 1) max unit v il cmos type low level input voltage. port b pins. (see fig 11.13) 1.5 v ttl type schmitt trigger low level input voltage. port a and port c pins. (see fig. 11.12) 0.8 v ih cmos type high level input voltage. port b pins. (see fig 11.13) 3.3 ttl type schmitt trigger high level input voltage. port a and port c pins. (see fig. 11.12) 2.2 v hys schmitt trigger voltage hysteresis 2) 1 i l input leakage current v ss v in v dd 1 m a i s static current consumption 3) floating input mode 200 vdd st52 unused i/o port 10k unused i/o port st52 10k
st52t430/e430 78/88 subject to general operating conditions for v dd , f osc , and t a, unless otherwise specified. notes: 1. the i io current sunk must always respects the absolute maximum rating specified in section 12.2 and the sum of i io (i/o ports and control pins) must not exceed i vss 2. the i io sourced current must always respect the absolute maximum rating specified in section 12.2 and the sum of i io (i/o ports and control pins) must not exceed i vdd. table 12.11 output voltage levels symbol parameter conditions min typ max unit v ol 1) output low level voltage for standard i/o pin when 8 pins are sunk at same time. v dd =5v, i io =+8ma v ss + 0.4 v v oh 2) output high level voltage for standard i/ o pin when 8 pins are sourced at same time. v dd =5v, i io =- 8ma v dd - 0.5 figure 12.12 ttl-level input schmitt trigger 0.5 0.8 1.0 1.5 2.0 2.5 0 1 2 3 4 5 v = 5v dd t = 25c a (typical) v (v) o v (v) i figure 12.13 port b pins cmos-level input 2.0 3.3 5.0 0 1 2 3 4 5 v = 5v dd t = 25c a (typical) v (v) o v (v) i
st52t430/e430 79/88 subject to general operating condition for v dd , f osc , and t a , unless otherwise specified. figure 12.14 port a and port c pin equivalent circuit figure 12.15 port b pin equivalent circuit table 12.12 output driving current symbol parameter test conditions min typ max unit r s input protection resistor all input pins 1 k w c s pin capacitance all input pins 5 pf v v device v v v r dd ss ss in out s c s input/output v input/output device ss v c s v ss s r o u t v i n v dd
st52t430/e430 80/88 12.9 control pin characteristics 12.9.1 reset pin. subject to general operating conditions for v dd , f osc , and t a, unless otherwise specified 12.9.2 v pp pin. subject to general operating conditions for v dd, f osc , and t a ,unless otherwise specified. notes: 1. data is based on characterization results, not tested in production. 2. hysteresis voltage between schmitt trigger switching level. based on characterization results not tested in production. 3. data is based on design simulation and/or technology characteristics, not tested in production. 4. in working mode v pp must be tied to v ss table 12.13 reset pin symbol parameter conditions min typ max unit v il input low level voltage 1) v dd = 5 v 1.8 v v ih input high level voltage 1) v dd = 5 v 2.8 v hys schmitt trigger voltage hysteresis 2) v dd = 5 v 0.8 t w(rstl)out general reset pulse duration 30 m s t h(rstl)int external reset pulse hold time 20 table 12.14 v pp 4) pin symbol parameter conditions min typ max unit v il input low level voltage 3) v ss 0.2 v v ih input high level voltage 3) v dd -0.1 12.6
st52t430/e430 81/88 12.10 8-bit a/d characteristics subject to general operating conditions for v dd , f osc , and t a , unless otherwise specified. notes: 1. noise on v dda , v ssa < 40 mv symbol parameter conditions min typ max unit res resolution 8 bit a tot total accuracy 1) 1 mhz st52t430/e430 82/88 table 12.15 ss034 package mechanical data dim mm inch. min typ. max min typ. max a 2.4638 2.6416 0.097 0.104 a1 0.127 0.2921 0.005 0.0115 b 0.3556 0.4826 0.014 0.019 c 0.23114 0.3175 0.0091 0.0125 d 17.7292 18.0594 0.698 0.711 e 7.4168 7.5946 0.292 0.299 e 1.016 0.040 h 10.16 10.414 0.400 0.410 h 0.635 0.7366 0.025 0.029 k0 8 0 8 l 0.6096 1.016 0.024 0.040 1 17 18 34 e e b a a 1 h h h c l k
st52t430/e430 83/88 table 12.16 pdip32 shrink package mechanical data dim mm inch min typ. max min typ. max a 0.140 0.148 0.200 a1 0.02 a2 0.120 0.140 0.18 b 0.014 0.018 0.023 b1 0.030 0.040 0.055 c 0.008 0.010 0.014 d 1.080 1.100 1.120 e 0.390 0.410 0.435 e1 0.300 0.350 0.370 e 0.070 eal 0.400 eb 0.500 ec 0.055 l 0.100 0.120 0.150 1 32 17 16 b1 b e a l a 1 a 2 d e ec e 1 e a e b c
st52t430/e430 84/88 table 12.17 csdip32w shrink package mechanical data dim mm inch. min typ. max min typ. max a 0.097 0.115 0.133 a1 0.025 0.035 0.045 b 0.016 0.018 0.020 b1 0.035 c 0.008 0.010 0.012 d 1.168 1.180 1.192 d1 1.042 1.050 1.058 e1 0.382 0.390 0.398 e 0.065 0.070 0.075 g 0.375 g1 0.580 g2 0.044 l 0.170 0.175 0.180 q 0.290 g1 b e l a 1 a g 2 d1 d b1 q c g 1 e 1
st52t430/e430 85/88 table 12.18 tqfp32 package mechanical data dim mm inch. min typ. max min typ. max a 1.60 0.063 a1 0.05 0.15 0.002 0.006 a2 1.35 1.40 1.45 0.053 0.055 0.057 b 0.30 0.37 0.45 0.012 0.015 0.018 c 0.09 0.20 0.004 0.008 d 9.00 0.354 d1 7.00 0.276 d3 5.60 0.220 e 0.80 0.031 e 9.00 0.354 e1 7.00 0.276 e3 5.60 0.220 l 0.45 0.60 0.75 0.018 0.024 0.030 l1 1.00 0.039 k 0(min.), 7(max.)
st52t430/e430 86/88 ordering information each device is available for production in user programmable version (otp) as well as in factory pro- grammed version (fastrom). otp devices are shipped to the customer with a default blank content ffh, while fastrom factory programmed parts contain the code sent by the customer. there is one common eprom version for debugging and prototyping, which features the maximum memory size and peripherals of the family. care must be taken only to use resources available on the target device. figure 12.16 device types selection guide part number temperature range package st52t430k1m6 -40 to +85 c sso34 st52t430k2m6 -40 to +85 c sso34 st52t430k3m6 -40 to +85 c sso34 st52t430k1b6 -40 to +85 c psdip32 st52t430k2b6 -40 to +85 c psdip32 st52t430k3b6 -40 to +85 c psdip32 ST52T430K1T6 -40 to +85 c tqfp32 st52t430k2t6 -40 to +85 c tqfp32 st52t430k3t6 -40 to +85 c tqfp32 st52e430k3d6 -40 to +85 c csdip32w st52x430/kit development kit st52 t nnn c m p y temperature range: 6 = - 40 to 85 c packages: b = pdip m = pso t = tqfp memory size: 1 = 2 kb 2 = 4 kb 3 = 8 kb pin count: k = 32/34 pin subfamily: 430 memory type: t = otp e = eprom family
st52t430/e430 87/88
88/88 full product information at http://mcu.st.com information furnished is believed to be accurate and reliable. however, stmicroelectronics assumes no responsibility for the co nsequences of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. no license is granted by implication or otherwise under any patent or patent rights of stmicroelectronics. specification mentioned in this publicatio n are subject to change without notice. this publication supersedes and replaces all information previously supplied. stmicroelectronics product s are not authorized for use as critical components in life support devices or systems without express written approval of stmicroelectro nics. the st logo is a registered trademark of stmicroelectronics ? 2003 stmicroelectronics C printed in italy C all rights reserved stmicroelectronics group of companies australia - brazil - china - canada - finland - france - germany - hong kong - india - israel - italy - japan - malaysia - malt a - morocco - singapore - spain - sweden - switzerland - united kingdom - u.s.a. http://www.st.com


▲Up To Search▲   

 
Price & Availability of ST52T430K1T6

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X